Skip to content

mildronize/blog-v8

Repository files navigation

Thadaw Site (v8)

A modern, fast, and feature-rich static site powered by Zola and deployed seamlessly on Azure Static Web Apps.

🚀 Features

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

🛠️ Local Development

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

How to Debug Frontend with Vite

Frontend Centric

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

Zola Theme Centric

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

🔑 Generate Azure Credentials

To enable the Deploy to Azure Static Web App GitHub Action for preview environments, you need to generate Azure credentials:

  1. 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
  2. Copy the output JSON and add it as a GitHub secret in your repository settings with the name AZURE_CREDENTIALS.

📄 License

This project is licensed under the MIT License.