Inside of my Astro project, you'll see the following folders and files:
/
โโโ .github/workflows/
โ โโโ deploy.yml
โโโ public/
โโโ src/
โโโ lib/
โ โโโ components
โ โโโ layouts
โโโ pages/
โ โโโ [...page]/
โ โโโ posts/
โ โโโ tags/[path]/[...page]/
โโโ styles/
โโโ global.scss
โโโ md.scss
Descriptions:
folder | descriptions |
---|---|
.github/workflows/ |
Github deploy file |
public |
images .e.c logo.png |
src/lib/ |
common components and layouts |
src/styles/ |
includes layout and markdown page's styles. |
src/pages/[...page] |
this route will match the main page index.html , why use [...page] here? course have paginate in index.html, [...page] will get the page number. |
src/pages/posts/ |
all markdown article pages. |
src/pages/tags/[path]/[...page]/ |
multi-level routes for tags list, first, path route match which tag , then [...page] route match the page number of list |
Delete
all files insrc/pages/posts/
folder.- Write your blog post in
src/pages/posts/
. Program will read all*.md
files under this folder. *.md
file usesrc/lib/layouts/md.astro
as layout.