Skip to content

Commit b4e3b0c

Browse files
inklessclaude
andcommitted
Switch from Cactus to PaperMod theme with Hugo Modules
- Replace Cactus git submodule with PaperMod via Hugo Modules - Modernize GitHub Actions workflow to use native Pages deployment - Convert projects list from data/projects.json to content/projects.md - Update hugo.toml with PaperMod params (dark theme, social icons, etc.) - Add AGENTS.md and CLAUDE.md for project guidance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6ab6be3 commit b4e3b0c

File tree

10 files changed

+163
-72
lines changed

10 files changed

+163
-72
lines changed

.github/workflows/gh-pages.yml

Lines changed: 62 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,76 @@
1-
name: github pages
1+
name: Deploy Hugo to GitHub Pages
22

33
on:
44
push:
55
branches:
6-
- main # Set a branch to deploy
7-
pull_request:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
817

918
jobs:
10-
deploy:
11-
runs-on: ubuntu-22.04
12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
19+
build:
20+
runs-on: ubuntu-latest
21+
env:
22+
HUGO_VERSION: "0.155.2"
1423
steps:
15-
- uses: actions/checkout@v4
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Setup Go
30+
uses: actions/setup-go@v5
1631
with:
17-
submodules: true # Fetch Hugo themes (true OR recursive)
18-
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
32+
go-version: "1.23"
1933

2034
- name: Setup Hugo
21-
uses: peaceiris/actions-hugo@v2
35+
run: |
36+
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
37+
sudo dpkg -i ${{ runner.temp }}/hugo.deb
38+
39+
- name: Cache Hugo modules
40+
uses: actions/cache@v4
2241
with:
23-
hugo-version: "0.119.0"
24-
extended: true
42+
path: /tmp/hugo_cache
43+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
44+
restore-keys: |
45+
${{ runner.os }}-hugomod-
46+
47+
- name: Setup Pages
48+
id: pages
49+
uses: actions/configure-pages@v5
2550

26-
- name: Build
27-
run: hugo --minify
51+
- name: Build with Hugo
52+
env:
53+
HUGO_CACHEDIR: /tmp/hugo_cache
54+
HUGO_ENVIRONMENT: production
55+
TZ: America/Los_Angeles
56+
run: |
57+
hugo \
58+
--gc \
59+
--minify \
60+
--baseURL "${{ steps.pages.outputs.base_url }}/"
2861
29-
- name: Deploy
30-
uses: peaceiris/actions-gh-pages@v3
31-
if: github.ref == 'refs/heads/main'
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v3
3264
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./public
65+
path: ./public
66+
67+
deploy:
68+
environment:
69+
name: github-pages
70+
url: ${{ steps.deployment.outputs.page_url }}
71+
runs-on: ubuntu-latest
72+
needs: build
73+
steps:
74+
- name: Deploy to GitHub Pages
75+
id: deployment
76+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.hugo_build.lock
22
public/
3+
.claude/*.local.*

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Personal blog/website at [guangda.me](https://guangda.me), built with Hugo using the PaperMod theme (dark mode). Deployed to GitHub Pages via GitHub Actions.
8+
9+
## Commands
10+
11+
- **Setup** (first time after clone): `hugo mod get`
12+
- **Dev server**: `hugo server -D` (includes drafts)
13+
- **Build**: `hugo --minify`
14+
- **New post**: `hugo new posts/<slug>.md`
15+
16+
## Architecture
17+
18+
- **Hugo version**: 0.155.2 (extended), pinned in `.github/workflows/gh-pages.yml`
19+
- **Theme**: PaperMod, installed via Hugo Modules (no git submodule)
20+
- **Content**: Markdown files in `content/` using `+++` TOML front matter (not `---` YAML)
21+
- **Projects list**: `content/projects.md` — a standalone markdown page listing projects
22+
- **Static assets**: `static/images/` for images, `static/CNAME` for custom domain
23+
- **Deployment**: Pushing to `main` triggers a GitHub Actions workflow that builds with Hugo and deploys directly to GitHub Pages (no `gh-pages` branch). Source: `actions/configure-pages` + `actions/deploy-pages`.
24+
25+
## Content Conventions
26+
27+
- Posts use TOML front matter with `title`, `author`, `date`, `lastmod`, `categories`, `draft` fields
28+
- The `about.md` page lives at `content/about.md` (not in posts)
29+
- Date format: `2006-01-02` (Go reference time)
30+
- Code highlighting: Dracula style with line numbers

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

content/projects.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
+++
2+
title = "Projects"
3+
date = 2021-07-06T23:17:00-07:00
4+
lastmod = 2025-01-27T00:00:00-07:00
5+
draft = false
6+
+++
7+
8+
- [Keevo](https://www.keevowallet.com/) — A crypto currency wallet
9+
- [Dotfiles](https://github.com/inkless/dotfiles) — My dotfiles
10+
- [Node.js U2F](https://github.com/inkless/u2f-host-node) — A node.js implementation of u2f protocol
11+
- [React starter kit](https://github.com/inkless/react-starter-kit) — Yet another react starter kit
12+
- [Electron starter](https://github.com/inkless/electron-react-redux-typescript) — A electron boilerplate with TypeScript, React, and redux
13+
- [WE framework](https://webenergy.github.io) — A FE framework used by shanda online
14+
- [Dragger](https://github.com/inkless/dragger) — A drag and drop library for PC and mobile
15+
- [Static sites](https://slides.guangda.me) — A collection of static sites/slides

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/inkless/guangda.me
2+
3+
go 1.25.7
4+
5+
require github.com/adityatelange/hugo-PaperMod v0.0.0-20260125152547-3bb0ca281fd1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/adityatelange/hugo-PaperMod v0.0.0-20260125152547-3bb0ca281fd1 h1:nS0GAIWJZIxy1YWwGce18ePQHB7v1Y1sxUTOOrBAIeA=
2+
github.com/adityatelange/hugo-PaperMod v0.0.0-20260125152547-3bb0ca281fd1/go.mod h1:HCHxNMKYdGafUYjVV3ICiAqznZK2yH0iI53jqcDFDdQ=

hugo.toml

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
baseURL = "https://guangda.me"
22
languageCode = "en-us"
33
title = "Guangda Zhang's space - 无墨阁"
4-
theme = "cactus"
54
copyright = "Guangda Zhang"
65

6+
[module]
7+
[[module.imports]]
8+
path = "github.com/adityatelange/hugo-PaperMod"
9+
10+
[[menu.main]]
11+
name = "Home"
12+
url = "/"
13+
weight = 1
14+
715
[[menu.main]]
8-
name = "Home"
9-
url = "/"
10-
weight = 1
16+
name = "Writings"
17+
url = "/posts"
18+
weight = 2
1119

1220
[[menu.main]]
13-
name = "Writings"
14-
url = "/posts"
15-
weight = 2
21+
name = "Projects"
22+
url = "/projects"
23+
weight = 3
1624

1725
[[menu.main]]
18-
name = "Tags"
19-
url = "/tags"
20-
weight = 3
26+
name = "Tags"
27+
url = "/tags"
28+
weight = 4
2129

2230
[[menu.main]]
23-
name = "Categories"
24-
url = "/categories"
25-
weight = 4
31+
name = "Categories"
32+
url = "/categories"
33+
weight = 5
2634

2735
[[menu.main]]
28-
name = "About"
29-
url = "/about"
30-
weight = 5
36+
name = "About"
37+
url = "/about"
38+
weight = 6
3139

3240
[markup]
3341
[markup.tableOfContents]
@@ -41,46 +49,37 @@ weight = 5
4149
lineNoStart = 1
4250
lineNos = true
4351
lineNumbersInTable = false
44-
noClasses = true
52+
noClasses = false
4553
style = "dracula"
4654
tabWidth = 4
4755

4856
[params]
49-
50-
colortheme = "dark" # dark, light, white, or classic
51-
rss = true # generate rss feed. default value is false
52-
googleAnalyticsAsync = true # use asynchronous tracking. Synchronous tracking by default
53-
showAllPostsArchive = false # default
54-
# gravatar = "zhangxiaoyu9350@gmail.com"
55-
56-
# Home page settings
57+
defaultTheme = "dark"
58+
ShowReadingTime = true
59+
ShowShareButtons = false
60+
ShowPostNavLinks = true
61+
ShowBreadCrumbs = true
62+
ShowCodeCopyButtons = true
63+
DateFormat = "2006-01-02"
5764
description = "Welcome to my space, I will share my thoughts, life here."
58-
mainSection = "posts" # your main section
59-
showAllPostsOnHomePage = false # default
60-
postsOnHomePage = 5 # this option will be ignored if showAllPostsOnHomePage is set to true
61-
tagsOverview = true # show tags overview by default.
62-
showProjectsList = true # show projects list by default (if projects data file exists).
63-
projectsUrl = "https://github.com/inkless" # title link for projects list
64-
65-
# https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference
66-
dateFormat = "2006-01-02" # default
65+
author = "Guangda Zhang"
66+
mainSections = ["posts"]
6767

68-
# Post page settings
69-
show_updated = true # default
70-
showReadTime = true # default
68+
[params.homeInfoParams]
69+
Title = "Hi, I'm Guangda Zhang"
70+
Content = "Welcome to my space, I will share my thoughts, life here."
7171

72-
[params.comments]
73-
enabled = false # default
74-
engine = "disqus" # more supported engines will be added.
72+
[params.assets]
73+
disableHLJS = true
7574

76-
# the value of name should be an valid font awesome icon name (brands type)
77-
# https://fontawesome.com/icons?d=gallery&s=brands
78-
[[params.social]]
75+
[[params.socialIcons]]
7976
name = "github"
80-
link = "https://github.com/inkless"
81-
[[params.social]]
77+
url = "https://github.com/inkless"
78+
79+
[[params.socialIcons]]
8280
name = "linkedin"
83-
link = "https://www.linkedin.com/in/guangda-zhang/"
84-
[[params.social]]
81+
url = "https://www.linkedin.com/in/guangda-zhang/"
82+
83+
[[params.socialIcons]]
8584
name = "email"
86-
link = "g@guangda.me" # no need for "mailto:" in the head
85+
url = "mailto:hi@guangda.me"

themes/cactus

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)