A modern, fast, and feature-rich static site powered by Zola and deployed seamlessly on Azure Static Web Apps.
- Static Site Generator: Built using Zola, a Rust-powered static site generator.
- Serene Theme: Based on the elegant Serene theme.
- Automatic Post ID Generation: Each post gets a unique ID, auto-generated when pushed to the main branch using the Auto Add Post ID GitHub Action.
- Azure Static Web Apps Deployment:
- Automatic deployment to production when changes are pushed to the main branch using Deploy to Azure Static Web App GitHub Action.
- Automatic preview deployments triggered by pull requests.
- Dynamic 404 Handling: Automatically resolves URLs with a post ID to the correct post. For example,
/s/123
redirects to/post/this-is-a-post
. - Enable Giscus comment, which is already provided by the theme.
- Enable Anonymous Reaction, any user can react with Emoji ❤️ to the post without login, which is already provided by the theme.
- The backend is reimplemented in Azure Functions with TypeScript. Checkout Reaction repo for more detail.
Follow these steps to set up the project for local development:
# Clone the repository
git clone git@github.com:mildronize/blog-v8.git
# Initialize and update submodules
git submodule update --init --recursive
# Start the development server
make dev
Start the server with cors allowed, then you can debug the frontend with Vite
This will serve the search index file in the /api
path
make serve
Run the vite server
cd snippets && bun install && bun dev
If you want to debug the theme, you can run the Zola server with the following command
make dev
and open another terminal and run the vite server
cd snippets && bun install && bun run build:watch
To enable the Deploy to Azure Static Web App GitHub Action for preview environments, you need to generate Azure credentials:
-
Run the following command in your Azure CLI to create a service principal:
az ad sp create-for-rbac --name "github-actions/deploy/thadaw-main-site-v8" --role contributor --scopes /subscriptions/xxxxxx/resourceGroups/rg-open-sources/providers/Microsoft.Web/staticSites/thadaw-main-site-v8 --sdk-auth
-
Copy the output JSON and add it as a GitHub secret in your repository settings with the name
AZURE_CREDENTIALS
.
This project is licensed under the MIT License.