A fast, minimal blog powered by Hugo and the PaperMod theme. This README covers local setup, content authoring, customization, and deployment to GitHub Pages.
- Hugo (extended) v0.148.0 or newer
- macOS (Homebrew):
brew install hugo
- Verify you have the extended build:
hugo version # look for "+extended" in the output
- macOS (Homebrew):
- Git and GitHub account (for deployment)
# Clone
git clone https://github.com/davshiv20/davshiv20github.io.git
cd davshiv20github.io
# Run local server
hugo server -D
# Visit http://localhost:1313hugo.toml– Site config (title, theme, params, baseURL, pagination, markup)content/– Markdown contentcontent/_index.md– Home page contentcontent/posts/– Blog posts
archetypes/– Default front matter for new contentthemes/PaperMod/– Theme (checked into repo; no submodule required)layouts/– Local overrides/partials (takes precedence over theme)public/– Generated site output (built by Hugo).github/workflows/deploy.yaml– GitHub Actions workflow for Pages
- Start dev server with drafts and live reload:
hugo server -D
- Build production site to
public/:hugo --gc --minify
- Match CI version locally (recommended):
# CI uses 0.148.0; ensure you have a compatible version hugo version
- New post (draft by default from
archetypes/default.md):hugo new posts/my-new-post.md
- Edit the new file under
content/posts/and setdraft = falseto publish. - Front matter defaults:
title– inferred from filenamedate– created datedraft– starts astrue
Key settings in hugo.toml:
baseURL = "https://davshiv20.github.io/"– Must match your GitHub Pages URLtheme = 'PaperMod'enableRobotsTXT = truepagination.pagerSize = 5params.env = "production"params.googleAnalytics = ""– Set to your GA measurement ID if using GA- Goldmark unsafe HTML is enabled to allow raw HTML in Markdown
After changing baseURL, rebuild and redeploy to reflect canonical URLs.
- PaperMod is vendored under
themes/PaperMod/. - To override theme templates/partials, add files under
layouts/mirroring the theme paths. Hugo will prefer your locallayouts/over the theme. - Custom partials:
layouts/partials/google_analytics.html– Optional custom GA injection. If using PaperMod built-in GA viaparams.googleAnalytics, you may not need this.
- Styling:
- For light overrides, add assets under
assets/orstatic/and reference them in a custom head partial (e.g.,layouts/partials/extend_head.html).
- For light overrides, add assets under
This repo is configured to deploy with GitHub Actions to GitHub Pages:
- Workflow:
.github/workflows/deploy.yaml- Triggers on pushes to
master - Uses Hugo extended v0.148.0
- Builds the site and publishes the
public/artifact to GitHub Pages
- Triggers on pushes to
One-time GitHub setup:
- In GitHub repo settings, enable Pages:
- Settings → Pages → Build and deployment → Source: "GitHub Actions"
- Ensure default branch is
master(or update the workflow trigger if you change it).
Deploying changes:
git add -A
git commit -m "Update content"
git push origin master
# GitHub Actions will build and deploy automaticallyNotes:
- You do not need to commit
public/when using the Actions workflow; CI builds it. Ifpublic/is currently tracked, you can keep it, but it’s optional for Pages via Actions. - If you change the site URL or repository name, update
baseURLinhugo.toml.
- Missing styles or 404s locally:
- Run with
hugo server -D(it handles baseURL differences).
- Run with
- GA not recording:
- Set
params.googleAnalyticsinhugo.tomlor ensure your custom GA partial is included.
- Set
- Version mismatch errors in CI:
- Update your local Hugo to match CI (0.148.0) or adjust the workflow
HUGO_VERSION.
- Update your local Hugo to match CI (0.148.0) or adjust the workflow
- Theme not applied:
- Confirm
theme = 'PaperMod'inhugo.tomland that the theme directory exists.
- Confirm
Content is yours. PaperMod theme is licensed per themes/PaperMod/LICENSE.