|
1 | | -# Astro Starter Kit: Basics |
| 1 | +# Personal Photo Blog |
2 | 2 |
|
3 | | -``` |
4 | | -npm create astro@latest -- --template basics |
5 | | -``` |
| 3 | +A modern, responsive photo blog built with React, featuring masonry layout and lazy loading for optimal performance. |
| 4 | + |
| 5 | +## 🌟 Features |
| 6 | + |
| 7 | +- Masonry grid layout for beautiful photo arrangements |
| 8 | +- Lazy loading images for better performance |
| 9 | +- WebP image support with fallback |
| 10 | +- Photo grouping and filtering |
| 11 | +- Responsive design |
| 12 | +- Modern image optimization |
6 | 13 |
|
7 | | -[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) |
8 | | -[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics) |
9 | | -[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json) |
| 14 | +## 🛠 Tech Stack |
10 | 15 |
|
11 | | -> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! |
| 16 | +- React |
| 17 | +- Masonry Layout |
| 18 | +- Vanilla-LazyLoad |
| 19 | +- ImagesLoaded |
| 20 | +- Nano Stores for state management |
12 | 21 |
|
13 | | - |
| 22 | +## 🚀 Getting Started |
14 | 23 |
|
15 | | -## 🚀 Project Structure |
| 24 | +1. Clone the repository: |
| 25 | +```bash |
| 26 | +git clone https://github.com/yourusername/MyBlog.git |
| 27 | +cd MyBlog |
| 28 | +``` |
16 | 29 |
|
17 | | -Inside of your Astro project, you'll see the following folders and files: |
| 30 | +2. Install dependencies: |
| 31 | +```bash |
| 32 | +npm install |
| 33 | +``` |
18 | 34 |
|
| 35 | +3. Start the development server: |
| 36 | +```bash |
| 37 | +npm run dev |
19 | 38 | ``` |
20 | | -/ |
21 | | -├── public/ |
22 | | -│ └── favicon.svg |
23 | | -├── src/ |
24 | | -│ ├── components/ |
25 | | -│ │ └── Card.astro |
26 | | -│ ├── layouts/ |
27 | | -│ │ └── Layout.astro |
28 | | -│ └── pages/ |
29 | | -│ └── index.astro |
30 | | -└── package.json |
| 39 | + |
| 40 | +## 📸 Adding Photos |
| 41 | + |
| 42 | +1. Place your photos in the `src/images` directory |
| 43 | +2. Update `src/data/photos.json` with your photo information: |
| 44 | +```json |
| 45 | +{ |
| 46 | + "photoGroups": { |
| 47 | + "group-name": [ |
| 48 | + { |
| 49 | + "src": "/path/to/image.webp", |
| 50 | + "alt": "Image description", |
| 51 | + "caption": "Optional caption", |
| 52 | + "date": "2023-12-25" |
| 53 | + } |
| 54 | + ] |
| 55 | + } |
| 56 | +} |
31 | 57 | ``` |
32 | 58 |
|
33 | | -Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. |
| 59 | +## 🔧 Configuration |
34 | 60 |
|
35 | | -There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. |
| 61 | +- Image lazy loading threshold can be adjusted in `PhotoStream.jsx` |
| 62 | +- Masonry grid settings can be modified in `PhotoStream.jsx` |
36 | 63 |
|
37 | | -Any static assets, like images, can be placed in the `public/` directory. |
| 64 | +## 📱 Browser Support |
38 | 65 |
|
39 | | -## 🧞 Commands |
| 66 | +- Modern browsers (Chrome, Firefox, Safari, Edge) |
| 67 | +- WebP support with fallback to original formats |
| 68 | +- Responsive design for mobile and desktop |
40 | 69 |
|
41 | | -All commands are run from the root of the project, from a terminal: |
| 70 | +## 📄 License |
42 | 71 |
|
43 | | -| Command | Action | |
44 | | -| :------------------------ | :----------------------------------------------- | |
45 | | -| `npm install` | Installs dependencies | |
46 | | -| `npm run dev` | Starts local dev server at `localhost:3000` | |
47 | | -| `npm run build` | Build your production site to `./dist/` | |
48 | | -| `npm run preview` | Preview your build locally, before deploying | |
49 | | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | |
50 | | -| `npm run astro -- --help` | Get help using the Astro CLI | |
| 72 | +MIT License - feel free to use this project for your own photo blog! |
51 | 73 |
|
52 | | -## 👀 Want to learn more? |
| 74 | +## 🤝 Contributing |
53 | 75 |
|
54 | | -Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). |
| 76 | +Contributions are welcome! Please feel free to submit a Pull Request. |
0 commit comments