Skip to content

Commit 5f1da6a

Browse files
feat: astro template
1 parent d39d843 commit 5f1da6a

22 files changed

+8997
-0
lines changed

templates/website/astro/.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Various IDEs and Editors
2+
.vscode/
3+
.idea/
4+
**/*~
5+
6+
# Mac OSX temporary files
7+
.DS_Store
8+
**/.DS_Store
9+
10+
# build output
11+
dist/
12+
# generated types
13+
.astro/
14+
15+
# dependencies
16+
node_modules/
17+
18+
# logs
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
pnpm-debug.log*
23+
24+
# environment variables
25+
.env
26+
.env.production
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/** @type {import("prettier").Config} */
2+
export default {
3+
plugins: ["prettier-plugin-astro"],
4+
overrides: [
5+
{
6+
files: "*.astro",
7+
options: {
8+
parser: "astro",
9+
},
10+
},
11+
],
12+
};

templates/website/astro/README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Astro Starter Kit: Blog
2+
3+
```sh
4+
npm create astro@latest -- --template blog
5+
```
6+
7+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
8+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)
10+
11+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
13+
![blog](https://github.com/withastro/astro/assets/2244813/ff10799f-a816-4703-b967-c78997e8323d)
14+
15+
Features:
16+
17+
- ✅ Minimal styling (make it your own!)
18+
- ✅ 100/100 Lighthouse performance
19+
- ✅ SEO-friendly with canonical URLs and OpenGraph data
20+
- ✅ Sitemap support
21+
- ✅ RSS Feed support
22+
- ✅ Markdown & MDX support
23+
24+
## 🚀 Project Structure
25+
26+
Inside of your Astro project, you'll see the following folders and files:
27+
28+
```text
29+
├── public/
30+
├── src/
31+
│   ├── components/
32+
│   ├── content/
33+
│   ├── layouts/
34+
│   └── pages/
35+
├── astro.config.mjs
36+
├── README.md
37+
├── package.json
38+
└── tsconfig.json
39+
```
40+
41+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
42+
43+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
44+
45+
The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more.
46+
47+
Any static assets, like images, can be placed in the `public/` directory.
48+
49+
## 🧞 Commands
50+
51+
All commands are run from the root of the project, from a terminal:
52+
53+
| Command | Action |
54+
| :------------------------ | :----------------------------------------------- |
55+
| `npm install` | Installs dependencies |
56+
| `npm run dev` | Starts local dev server at `localhost:4321` |
57+
| `npm run build` | Build your production site to `./dist/` |
58+
| `npm run preview` | Preview your build locally, before deploying |
59+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
60+
| `npm run astro -- --help` | Get help using the Astro CLI |
61+
62+
## 👀 Want to learn more?
63+
64+
Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
65+
66+
## Credit
67+
68+
This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig } from "astro/config";
2+
import mdx from "@astrojs/mdx";
3+
import sitemap from "@astrojs/sitemap";
4+
5+
import tailwind from "@astrojs/tailwind";
6+
7+
// https://astro.build/config
8+
export default defineConfig({
9+
site: "https://example.com",
10+
integrations: [mdx(), sitemap(), tailwind()],
11+
devToolbar: {
12+
enabled: false,
13+
},
14+
});

0 commit comments

Comments
 (0)