
IMPORTANTRead Docs from Astro first.
Github-flavored Markdown is used as default syntax.
Math resolver:Katex
Where are the posts
Your post files should be placed in src/content/posts/
directory.
You can also create sub-directories to better organize your posts and assets.
src/content/posts/
├── post-1.md
└── post-2/
├── cover.png
└── index.md
Frontmatter
---
title: "Some title"
published: 1970-01-01
updated: 1970-01-02
description: "Some description"
image: "https://example.com/example.jpg"
tags: ["Atag", "AnotherTag"]
category: "Some category"
draft: false
lang: "en"
---
Attribute | Description |
---|---|
title | The title of the post. |
published | The date the post was published. |
updated | The date the post was updated. |
description | A short description of the post. Displayed on index page. |
image | The cover image path of the post. |
tags | The tags of the post. |
category | The category of the post. |
draft | If this post is still a draft, which won’t be displayed. |
lang | The language of this post. Used when generating searchdb with pagefind. |
Situations for image
:
- Start with
http://
orhttps://
: Use web image - Start with
/
: For image inpublic
dir - With none of the prefixes: Relative to the markdown file
Heading
# First-level heading
## Second-level heading
### Third-level heading
#### Fourth-level heading
##### Fifth-level heading
###### Sixth-level heading
TIPOnly first to third level heading will be shown in toc.
To get links for heading, just render post locally and get links from browser.
Text format
Bold
Italicized
Mistaken
Subscript
Superscript
Underlined
Dash-Dash—
Centered
☺…
Quote
Quote
Code
This is some code
apt upgrade -y
apt autoremove --purge
TIPTo use 3 backticks in code, use 4 backticks to wrap the codeblock.
To use codeblock in a list, indent the codeblock with 8 spaces.
Language hints are in Languages | Shiki.
Links
Custom redirect in post
<a name="redirect-to-top"></a>
Paragraph
This is the first line.
This is the second line.
This is another paragraph.
Image
List
- This is the first item.
- This is an item
- This is an item
- This is an item
- This is the second item.
Task
- Finished
- Not finished
Footnote
This is a footnote1.
Alert
NOTEThis is a note.
TIPThis is a tip.
IMPORTANTThis is a important message.
WARNINGThis is a warning.
CAUTIONThis is a caution
This is a custom titleThis is another note.
Hidden comment
This is some text.
Escape markdown format
Add a backslash (\
) before the markdown character. For example, *This is not markdown*.
Tables
CAUTIONNot working properly, see Bug: table in post is not aligned per markdown setting.
Key 1 | Item 2 | Key 3 | Key 4 |
---|---|---|---|
Value 1 | Value 2 | Value 3 | Value |4 |
Collapsed content
This should be unfolded by default
This is some content
Math
TIPTo escape math syntax, use
\$
inside math block, use<span>$</span>
outside math block (only for inline).
Github repo
Video
Footnotes
-
This is the information. ↩