README of this template
作者: Byron 最后更新: 2023-10-05
Astro Blog Template
This is a template for Astro blog. You can find source code in here.
This template is still in progress,you can see Demo in here
Highlights
- use astro to build static site
- pnpm as package manager
- seo friendly by astro-seo
- sitemap by astro-sitemap
- robots.txt by astro-robots-txt
- light & dark mode by astro-color-scheme
- responsive design, mobile first, 768px | 1024px | 1280px breakpoints
- unocss for css, also icon convenient
- i18n support by astro-i18next, you can switch language in footer after you add more language
- local search by astro-pagefind
- toc friendly when ever you device is mobile or desktop
- series support, you can add series in frontmatter of post with
string[]
orstring
Usage
-
generate repo from this template
-
change to your information in ‘src/setting’
-
put your post in ‘src/content/blog’
Update with template when first time
add template origin repo as upstream
git remote add origin-template [email protected]:byronogis/astro-blog-template.git
fetch template
git fetch origin-template
create a orphan template branch
git switch --orphan template
pull first
git pull origin-template main
set upstream to template
git branch -u origin-template/main template
merge template to main
git switch main
git merge template --allow-unrelated-histories --squash
# maybe you need to fix conflict
git add .
git commit -m "merge template"
Update with template when you have used this template
Switch to template branch
git switch template
pull
git pull
merge template to main
git switch main
git merge template --allow-unrelated-histories --squash
# maybe you need to fix conflict
git add .
git commit -m "merge template"
About fix conflict
In general, you just need to fix the conflict in ‘src/setting’. And other files, you can just use the template version.