Welcome to my Github repository to learn about the latest developments
Project structure
├── src/ │ ├── components/ # Component files │ ├── content/ # Content configuration │ ├── layouts/ # Layout templates │ ├── pages/ # Page routing │ └── styles/ # Style file ├── public/ # Static resources └── dist/ # Build output
Features
- 🎨 Modern UI design
- 🔍 Support local search and algolia full-text search
- 📱 Responsive design
- 🌙 Switch between dark and light themes
- 🏷️ Tag and category support
- 📊 Article statistics and author information display
How to install
Method One: Install using astro templates (choose any one)
pnpm create astro@latest --template passwordgloo/astro-theme-starread npm create astro@latest -- --template passwordgloo/astro-theme-starread yarn create astro --template passwordgloo/astro-theme-starread
Certainly, you can use `create` to create project
pnpm create astro-theme-starread my-blog npx create-astro-theme-starread my-blog yarn create astro-theme-starread my-blog cnpm init astro-theme-starread my-blog
Method Two: Initialize through the CLI tool (choose one)
pnpm dlx astro-theme-starread init npx astro-theme-starread init yarn dlx astro-theme-starread init
Method Three: Source code installation
git clone https://github.com/passwordgloo/astro-theme-starread cd astro-theme-starread pnpm install
Search
Local search
By default, local search is used. For the first use, please run 'pnpm local' to create a local index
Algolia search
It is recommended to use environment variables for configuration in the production environment to avoid exposing sensitive information in the code.
1. Edit 'starread.config.ts' and select Algolia to search
export const themeConfig: starreadthemeconfig = { search: { // Search service providers: 'local', 'algolia provider: 'algolia', } }
2. Create and edit the '.env 'file in the root directory
PUBLIC_ALGOLIA_APP_ID= your Algolia application ID PUBLIC_ALGOLIA_SEARCH_KEY= Your Algolia search key PUBLIC_ALGOLIA_INDEX_NAME= Your index name ALGOLIA_WRITE_API_KEY= Your administrator API key (for index upload)
Algolia search requires your Algolia application ID, search key, index name and administrator API key.
If you don't have an Algolia account, you need to register and create an application first.
3. Push the index to Algolia
Run 'pnpm algolia' to push the local index to Algolia