Skip to content
/ HsuBlog Public template

A beautiful, customized, personal blog theme for Astro

License

Notifications You must be signed in to change notification settings

KraHsu/HsuBlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HsuBlog πŸ’•πŸ‘

Built with Astro Typescript GitHub

δΈ­ζ–‡ζ–‡ζ‘£

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.

Live Demo 😎🌐

preview

Why HsuBlog πŸ€ͺ❓

  • 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 😁.

Project Structure πŸ€πŸ“‚

β”œβ”€β”€ 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.

Documentation πŸ“„πŸ‘“

You can find all you want (in the future) in the Demo

I will complete the documentation as soon as possible

Tech StackπŸ—οΈπŸ› οΈ

Framework : Astro & Vue
Type : TypeScript
Styling : Scss
Search : FuseJS
Icons : FontAwesome & IconPark
I18n : astro-i18next

Getting StartedπŸš€πŸ

1. Clone the repo πŸ“₯πŸ“

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

2. Install DependenciesπŸ§°βš™οΈ

npm install
# or
yarn install
# or 
pnpm install

3. Start development ServerπŸ–₯️⚑

npm run dev
# or
yarn dev
# or
pnpm dev

Preview & BuildπŸ—οΈπŸ‘€

npm run preview
npm run build
# or
yarn preview
yarn build
# or
pnpm preview
pnpm build

Other CommandsπŸŽ›οΈπŸ”§

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

To Do

...

Contribution πŸ’‘πŸ’¬

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).

LicenseπŸ“ƒπŸ”

Licensed under the MIT License, Copyright Β© 2023


Hope you enjoy it! β€οΈπŸŽ‰

Design & Build with ❀ by 枒葑KraHsu