Skip to content

Commit a1674f2

Browse files
committed
Initial commit
1 parent 26de602 commit a1674f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5503
-402
lines changed

README.md

+73-34
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,87 @@
1-
# Astro Starter Kit: Basics
1+
# salm.dev
22

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
69

7-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
8-
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
9-
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](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.
1011

11-
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
## Stack
1213

13-
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)
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
1420

15-
## 🚀 Project Structure
21+
## Development
1622

17-
Inside of your Astro project, you'll see the following folders and files:
23+
```bash
24+
# Install dependencies
25+
npm install
1826

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
2935
```
3036

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
3238

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
3459

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+
```
3683

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
4585

46-
## 👀 Want to learn more?
86+
MIT
4787

48-
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

astro.config.mjs

+40-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
1-
// @ts-check
21
import { defineConfig } from 'astro/config';
2+
import tailwind from '@astrojs/tailwind';
3+
import mdx from '@astrojs/mdx';
4+
import rehypePrettyCode from 'rehype-pretty-code';
5+
import remarkMath from 'remark-math';
6+
import rehypeKatex from 'rehype-katex';
7+
import codeTheme from './src/utils/code-theme.json';
38

4-
// https://astro.build/config
5-
export default defineConfig({});
9+
export default defineConfig({
10+
site: 'https://salm.dev',
11+
integrations: [
12+
tailwind(),
13+
mdx({
14+
remarkPlugins: [remarkMath],
15+
rehypePlugins: [rehypeKatex]
16+
})
17+
],
18+
markdown: {
19+
rehypePlugins: [
20+
[
21+
rehypePrettyCode,
22+
{
23+
theme: codeTheme,
24+
onVisitLine(node) {
25+
if (node.children.length === 0) {
26+
node.children = [{ type: 'text', value: ' ' }];
27+
}
28+
},
29+
onVisitHighlightedLine(node) {
30+
node.properties.className.push('highlighted');
31+
},
32+
onVisitHighlightedWord(node) {
33+
node.properties.className = ['word'];
34+
}
35+
}
36+
]
37+
],
38+
shikiConfig: {
39+
wrap: true
40+
}
41+
}
42+
});

0 commit comments

Comments
 (0)