HsuBlog is a beautiful, customized, personal blog theme for Astro ππ₯οΈ. This theme actually borrows a lot from hexo-butterfly and HeoBlog
This theme inherently followes best practices and assures accessibility as a fundamental feature πβ . Both light and dark modes are natively supported. Additionally, it offers superior customization options, allowing users to tailor their experience to their unique needs and preferences.
- super fast performance πβ‘
- dark mode πβ¨
- fuzzy search ππ‘
- pagination ππ
- tags and categories π·οΈπ
- sitemap & rss feed πΊοΈπ
- highly customizable π οΈπ¨
- "Local FontAwesome Icons" πΌοΈπ
- SEO-friendly π·οΈπ
- followed best practices β π₯
- markdown gfm, KaTex/Mathjax and some other unique extension syntax (in progress) ππ§
- i18n supported
- responsive (mobile ~ desktops)
PS: About the performance, It depends on how you use it. In my tests, lighthouses' performance scores averaged over 85. It can even reach 97 points without using large size pictures. Why not give it a try π.
βββ public # Files placed here will be copied to the website root directory as-is.
β βββ locales # Contains translation fields; theme comes with Chinese and English by default.
β β βββ en
β β β βββ translation.json
β β βββ zh
β β βββ translation.json
β βββ robots.txt
β βββ scripts # Contains required js and json files.
βββ src
βββ components # Theme components; typically unmodified.
βββ layouts # Theme layout files; typically unmodified.
βββ utils # Contains ts functions; typically unmodified.
βββ styles # Contains theme style files in .scss format.
β βββ custom.scss # Custom styles can be written here.
βββ pages # Contains pages.
βββ content # Contains blog files in .md format; all blog content is stored here.
β βββ blog
β β βββ en
β β β βββ default # Contains the default sample English blog.
β β βββ zh
β β βββ default # Contains the default sample Chinese blog.
β βββ config.ts
βββ env.d.ts # Type definitions; typically unmodified.
βββ exMarkdown # Contains functions related to Markdown compilation.
β βββ markdownThemes
β βββ darkTheme.json # Code block night mode style in VsCode format.
β βββ lightTheme.json # Code block daytime mode style in VsCode format.
βββ theme_config.ts # HsuBlog theme configuration file.
βββ site_config.ts # HsuBlog site configuration file.
Astro turns .astro
or .md
files in the src/pages/
directory into website routes, using their file path.
Any static resource should be placed in the public/
directory.
All blog posts are stored in src/content/blog
directory.
This theme provides a CLI for quickly creating these contents.
You can find all you want (in the future) in the Demo
I will complete the documentation as soon as possible
Framework : Astro & Vue
Type : TypeScript
Styling : Scss
Search : FuseJS
Icons : FontAwesome & IconPark
I18n : astro-i18next
You just need to run this code from your command line (pick one).
# git - Recommended for the convenience of subsequent updates
git clone https://github.com/KraHsu/HsuBlog.git
# or
# npm 6.x
npm create astro@latest --template KraHsu/HsuBlog
# or
# npm 7+, extra double-dash is needed:
npm create astro@latest -- --template KraHsu/HsuBlog
# or
# yarn
yarn create astro --template KraHsu/HsuBlog
npm install
# or
yarn install
# or
pnpm install
npm run dev
# or
yarn dev
# or
pnpm dev
npm run preview
npm run build
# or
yarn preview
yarn build
# or
pnpm preview
pnpm build
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
yarn run sync |
Generates TypeScript types. Learn more. |
yarn run new <title> |
Create a new post with the title |
yarn run newpage <title> |
Create a new page with the title |
yarn run abbr |
Add a permalink to markdown files title |
yarn run i18n |
Create basic internationalized pages (excluding already created Markdown files) |
use yarn run -h
for help
...
If you encounter any issues or have any suggestions, feel free to create Issues or submit Pull Requests.
You can also contact me through my email or QQ (1191393280).
Licensed under the MIT License, Copyright Β© 2023
Hope you enjoy it! β€οΈπ
Design & Build with β€ by ζ’θ‘‘KraHsu