|
1 |
| -# Astro Starter Kit: Basics |
| 1 | +# salm.dev |
2 | 2 |
|
3 |
| -```sh |
4 |
| -npm create astro@latest -- --template basics |
5 |
| -``` |
| 3 | +Personal website and blog built with Astro. |
| 4 | + |
| 5 | +## Acknowledgements |
| 6 | +- [@davidteather](https://github.com/davidteather): His guides on adding [interactive charts](https://dteather.com/blogs/astro-interactive-charts/) and [diagrams](https://dteather.com/blogs/astro-uml-diagrams/) were helpful. |
| 7 | + |
| 8 | +## Acknowledgements |
6 | 9 |
|
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) |
| 10 | +- [@davidteather](https://github.com/davidteather): His guides on adding [interactive charts](https://dteather.com/blogs/astro-interactive-charts/) and [diagrams](https://dteather.com/blogs/astro-uml-diagrams/) were helpful. |
10 | 11 |
|
11 |
| -> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! |
| 12 | +## Stack |
12 | 13 |
|
13 |
| - |
| 14 | +- [Astro](https://astro.build) - Static site generator |
| 15 | +- [Tailwind CSS](https://tailwindcss.com) - Styling |
| 16 | +- [MDX](https://mdxjs.com) - Enhanced markdown for blog posts ([Why MDX?](https://www.codemotion.com/magazine/frontend/how-to-create-an-mdx-blog-in-typescript-with-next-js/#:~:text=Typically%2C%20MDX%20is%20used%20for,to%20achieve%20with%20simple%20Markdown.)) |
| 17 | +- [KaTeX](https://katex.org) - Math typesetting |
| 18 | +- [Mermaid](https://mermaid.js.org) - Diagrams |
| 19 | +- [Recharts](https://recharts.org) - Interactive charts |
14 | 20 |
|
15 |
| -## 🚀 Project Structure |
| 21 | +## Development |
16 | 22 |
|
17 |
| -Inside of your Astro project, you'll see the following folders and files: |
| 23 | +```bash |
| 24 | +# Install dependencies |
| 25 | +npm install |
18 | 26 |
|
19 |
| -```text |
20 |
| -/ |
21 |
| -├── public/ |
22 |
| -│ └── favicon.svg |
23 |
| -├── src/ |
24 |
| -│ ├── layouts/ |
25 |
| -│ │ └── Layout.astro |
26 |
| -│ └── pages/ |
27 |
| -│ └── index.astro |
28 |
| -└── package.json |
| 27 | +# Start development server |
| 28 | +npx astro dev |
| 29 | + |
| 30 | +# Build for production |
| 31 | +npx astro build |
| 32 | + |
| 33 | +# Preview production build |
| 34 | +npx astro preview |
29 | 35 | ```
|
30 | 36 |
|
31 |
| -To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/). |
| 37 | +## Project Structure |
32 | 38 |
|
33 |
| -## 🧞 Commands |
| 39 | +``` |
| 40 | +src/ |
| 41 | +├── components/ # Reusable components |
| 42 | +│ ├── Chart.astro # Interactive chart component |
| 43 | +│ ├── Mermaid.astro # Diagram component |
| 44 | +│ └── ... |
| 45 | +├── content/ # Content collections |
| 46 | +│ ├── blog/ # Blog posts in MDX |
| 47 | +│ └── books/ # Reading list entries |
| 48 | +├── layouts/ # Page layouts |
| 49 | +│ ├── BlogPost.astro # Blog post template |
| 50 | +│ └── Layout.astro # Base site layout |
| 51 | +├── pages/ # Route pages |
| 52 | +│ ├── blog/ # Blog pages |
| 53 | +│ ├── books.astro # Reading list |
| 54 | +│ └── ... |
| 55 | +└── styles/ # Global styles |
| 56 | +``` |
| 57 | + |
| 58 | +## Content Collections |
34 | 59 |
|
35 |
| -All commands are run from the root of the project, from a terminal: |
| 60 | +### Blog Posts |
| 61 | +```markdown |
| 62 | +--- |
| 63 | +title: "Post Title" |
| 64 | +date: "2024-02-01" |
| 65 | +description: "Post description" |
| 66 | +--- |
| 67 | +``` |
| 68 | + |
| 69 | +### Books |
| 70 | +```markdown |
| 71 | +--- |
| 72 | +title: "Book Title" |
| 73 | +author: "Author Name" |
| 74 | +dateRead: "2024-02-01" |
| 75 | +rating: 5 |
| 76 | +tags: ["Category One", "Category Two"] |
| 77 | +review: "Book review text" |
| 78 | +links: |
| 79 | + goodreads: "https://goodreads.com/..." |
| 80 | + personalSite: "https://example.com" |
| 81 | +--- |
| 82 | +``` |
36 | 83 |
|
37 |
| -| Command | Action | |
38 |
| -| :------------------------ | :----------------------------------------------- | |
39 |
| -| `npm install` | Installs dependencies | |
40 |
| -| `npm run dev` | Starts local dev server at `localhost:4321` | |
41 |
| -| `npm run build` | Build your production site to `./dist/` | |
42 |
| -| `npm run preview` | Preview your build locally, before deploying | |
43 |
| -| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | |
44 |
| -| `npm run astro -- --help` | Get help using the Astro CLI | |
| 84 | +## License |
45 | 85 |
|
46 |
| -## 👀 Want to learn more? |
| 86 | +MIT |
47 | 87 |
|
48 |
| -Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). |
|
0 commit comments