Skip to content

LiuCMU/liucmu.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiuCMU.github.io

Personal blog built with Hugo and the Paige theme, deployed to GitHub Pages.

Local development

Prerequisites (already installed on this machine): Hugo extended, Go, Dart Sass.

# Live preview with drafts at http://localhost:6789
hugo server --buildDrafts --port 6789

# Production build into ./public
hugo --gc --minify

Light/dark mode toggle

color_scheme = "light" in hugo.toml compiles Bootstrap in data-attribute mode. Two project hooks add a manual toggle button (the theme is not forked):

  • layouts/partials/paige/head-last.html — applies the saved theme (or the visitor's OS preference on first visit) before paint, to avoid a flash.
  • layouts/partials/paige/site-header-last.html — the sun/moon toggle button and its click handler; the choice is remembered in localStorage.

Writing a new post

hugo new posts/my-post-title/index.md

Edit the new file, set draft = false (or remove it) when ready, then commit and push. The GitHub Actions workflow builds and deploys automatically.

How publishing works

  • Pushing to main/master triggers .github/workflows/hugo.yml.
  • The workflow installs Hugo + Go + Dart Sass, builds the site, and deploys to GitHub Pages.
  • In the repo: Settings → Pages → Build and deployment → Source: GitHub Actions.

Updating the theme

hugo mod get github.com/willfaught/paige@latest
hugo mod tidy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages