Compare commits
7 commits
818d64d3da
...
b9967c6ae9
Author | SHA1 | Date | |
---|---|---|---|
b9967c6ae9 | |||
1656ce4e53 | |||
fad49a03cd | |||
989a81295b | |||
eaf30ffc48 | |||
bc60b3a8ba | |||
9ec321cb6c |
10
.vscode/extensions.json
vendored
10
.vscode/extensions.json
vendored
|
@ -1,4 +1,12 @@
|
|||
{
|
||||
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
|
||||
"recommendations": [
|
||||
"astro-build.astro-vscode",
|
||||
"unifiedjs.vscode-mdx",
|
||||
"formulahendry.auto-rename-tag",
|
||||
"aaron-bond.better-comments",
|
||||
"oderwat.indent-rainbow",
|
||||
"ms-vscode.vscode-typescript-next",
|
||||
"davidanson.vscode-markdownlint"
|
||||
],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
|
|
81
README.md
81
README.md
|
@ -1,68 +1,37 @@
|
|||
# Astro Starter Kit: Blog
|
||||
# Blog in a Matrix
|
||||
|
||||
New blog site using [Astro](https://astro.build/).
|
||||
|
||||
## Workflow
|
||||
|
||||
Articles are written in markdown or MDX (I am using [Joplin](https://github.com/laurent22/joplin/)) then exported to `/src/content/blog`. The site can render [$\KaTeX$](https://katex.org/) and [Mermaid](https://mermaid.js.org/) content.
|
||||
|
||||
## Development
|
||||
|
||||
### Setup
|
||||
|
||||
Install dependencies:
|
||||
|
||||
```sh
|
||||
npm create astro@latest -- --template blog
|
||||
pnpm import
|
||||
```
|
||||
|
||||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
|
||||
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
|
||||
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)
|
||||
### Dev Server
|
||||
|
||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||
Start a development server using the following command:
|
||||
|
||||
![blog](https://github.com/withastro/astro/assets/2244813/ff10799f-a816-4703-b967-c78997e8323d)
|
||||
|
||||
Features:
|
||||
|
||||
- ✅ Minimal styling (make it your own!)
|
||||
- ✅ 100/100 Lighthouse performance
|
||||
- ✅ SEO-friendly with canonical URLs and OpenGraph data
|
||||
- ✅ Sitemap support
|
||||
- ✅ RSS Feed support
|
||||
- ✅ Markdown & MDX support
|
||||
|
||||
## 🚀 Project Structure
|
||||
|
||||
Inside of your Astro project, you'll see the following folders and files:
|
||||
|
||||
```text
|
||||
├── public/
|
||||
├── src/
|
||||
│ ├── components/
|
||||
│ ├── content/
|
||||
│ ├── layouts/
|
||||
│ └── pages/
|
||||
├── astro.config.mjs
|
||||
├── README.md
|
||||
├── package.json
|
||||
└── tsconfig.json
|
||||
```sh
|
||||
pnpm dev --open --host
|
||||
```
|
||||
|
||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||
The site should be now accessible at [http://localhost:4321/](http://localhost:4321/). A specific port can be specified using `--port` flag.
|
||||
|
||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
||||
### Build
|
||||
|
||||
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.
|
||||
Build deployable site:
|
||||
|
||||
Any static assets, like images, can be placed in the `public/` directory.
|
||||
```sh
|
||||
pnpm astro build
|
||||
```
|
||||
|
||||
## 🧞 Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `npm install` | Installs dependencies |
|
||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
||||
| `npm run build` | Build your production site to `./dist/` |
|
||||
| `npm run preview` | Preview your build locally, before deploying |
|
||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
||||
|
||||
## 👀 Want to learn more?
|
||||
|
||||
Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
||||
|
||||
## Credit
|
||||
|
||||
This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
|
||||
Built site can now be found at `/dist`.
|
||||
|
|
|
@ -46,4 +46,5 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props;
|
|||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
||||
|
||||
<!-- KaTeX Stylesheet -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
|
|
@ -44,10 +44,6 @@ import { SITE_TITLE } from '../consts';
|
|||
text-decoration: none;
|
||||
border-bottom-color: var(--accent);
|
||||
}
|
||||
.social-links,
|
||||
.social-links a {
|
||||
display: flex;
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.social-links {
|
||||
display: none;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/base",
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true
|
||||
"strictNullChecks": true,
|
||||
"allowJs": true
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue