English | 简体中文
Demo site for the PaperMod-academic-patch academic homepage theme: it shows what the theme looks like, and it can also be forked as the starting point of your own homepage.
Demo site: https://www.rayleizhu.com/PaperMod-academic-patch/
Developer's personal homepage (built with this template): https://rayleizhu.github.io/
The
mainbranch of this repository is the theme, theexampleSitebranch is the site (the branch you are looking at); the site pulls the theme in as a git submodule.
The idea is to deploy the template as-is first, then customize it locally, so you have a live site right from the start. 9 steps:
-
Fork this repository Fork it into your own GitHub account and name it
<username>.github.io(replace<username>with your GitHub username) — the site will then be served athttps://<username>.github.io. The default branch of this repository isexampleSite, and it stays that way after forking. -
Enable GitHub Pages Settings → Code and automation → Pages → Source: GitHub Actions.
-
Allow the deployment branch Settings → Environments → github-pages → Edit → Deployment branches: All branches (or add
exampleSiteonly).Hosting is ready at this point. To see what the template looks like, open the Actions tab, select
Deploy Hugo PaperMod Academic Demo to Pages→ Run workflow; once it finishes, visithttps://<username>.github.ioto browse the default site. You can also skip this — the build runs automatically when you push in step 9. -
Clone it locally Clone your fork; the theme is a submodule, so
--recursiveis required:git clone --recursive https://github.com/<username>/<username>.github.io.git cd <username>.github.io
If you already cloned it, or
themes/is empty, fetch the submodules:git submodule update --init --recursive
-
Install Hugo (extended build) The theme relies on SCSS compilation and image resizing, so you need the extended build,
0.146.0or newer; see Requirements below. Afterwards runhugo versionand make sure the output contains+extended. -
Fill in your own information
config.yml: name, position, affiliation, email, profile picture, experience, awards, social icons, top navigation (see Update your personal information).content/:about.md(bio),pubs/(publications),news/(news items),blog/(blog posts).
-
Update
baseURLSet thebaseURLat the top ofconfig.ymltohttps://<username>.github.io/(keep the trailing/). -
Preview locally Run
hugo serverin the repository root and open http://localhost:1313/; changes are hot-reloaded, so you can edit and check the result at the same time. -
Commit and push
git add -A && git commit -m "update my homepage" && git push
Pushing triggers the build and deployment; when it finishes, refresh
https://<username>.github.ioand your homepage is live. From then on every change is just "preview locally → commit and push".
| Component | Description |
|---|---|
| Hugo | Static site generator — the extended build is required (SCSS compilation, image resizing) |
| hugo-PaperMod | Base theme, included as a git submodule |
| PaperMod-academic-patch | Custom patch theme (the main branch of this repository), included as a git submodule; overrides the templates and styles of the homepage, publication list, news, etc. |
The two themes are nested: config.yml sets theme: [PaperMod-academic-patch, hugo-PaperMod], where the first one takes precedence and only overrides what it needs to change; everything else comes from upstream.
- Hugo extended ≥
0.146.0(min_versionofhugo-PaperMod; the deployment workflow pins0.146.0)
Pick either install method:
# 1) Official binary (recommended: you control the version; use ~/.local/bin when you have no root)
wget https://github.com/gohugoio/hugo/releases/download/v0.146.0/hugo_extended_0.146.0_linux-amd64.tar.gz
mkdir -p ~/.local/bin && tar -xzf hugo_extended_0.146.0_linux-amd64.tar.gz -C ~/.local/bin hugo
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
# 2) Package manager
brew install hugo # macOS
sudo apt install hugo # Debian/Ubuntu (make sure it is the extended build)Verify:
hugo version # the output must contain +extendedhugo server # local preview
hugo server -D # include drafts
hugo server --bind 0.0.0.0 --port 1313 # allow LAN / remote access
hugo # build only, output goes to public/To preview on a remote machine you need port forwarding:
ssh -L 1313:localhost:1313 <host>. Keep your local Hugo version in sync with the0.146.0pinned by the workflow to avoid differences in build behaviour (for example, newer Hugo releases fail on duplicate front matter keys).
.(site root)
├── assets/ # processed by Hugo Pipes (hashed, resized on demand)
│ └── images/
│ ├── prof_pic.webp # profile picture on the homepage
│ ├── papermod-cover.png # social sharing cover image
│ └── msg.png # sample post cover
├── content/
│ ├── about.md # bio (render: never — spliced into the homepage, not a standalone page)
│ ├── blog/ # blog
│ │ ├── posts/*.md
│ │ ├── archives.md # → /blog/archives/
│ │ └── search.md # → /blog/search/
│ ├── news/ # news
│ │ ├── _index.md # → /news/ full list (grouped by year)
│ │ └── 2023-03-01-*.md # single news item (render: never, used as data)
│ └── pubs/ # publications
│ ├── _index.md # → /pubs/ full list (switchable by topic / by year)
│ ├── 1905-*.md # single publication (render: never, used as data)
│ └── preview/ # publication images (headless bundle)
├── static/
│ └── assets/favicon_ae/ # favicons (copied as-is, no hash in the URL)
├── themes/
│ ├── hugo-PaperMod/ # submodule: upstream theme
│ └── PaperMod-academic-patch/ # submodule: the patch theme from the main branch
├── config.yml # site config (personal info, menus, social icons, ...)
└── .github/workflows/gh-pages.yml
Almost everything lives under params.profileMode in config.yml: title / subtitle / affiliation / email / imageUrl, experience, awards. A few switches worth knowing:
academic: true: enables the academic homepage (profile + bio + publications + news + experience + awards).sideBySideAbout: whentrue,about.mdis placed to the right of the profile picture; whenfalse, it becomes a separate section further down.showToc: whether to show the table of contents on the right.nameInPub: the name that gets bolded in publication author lists.
Social icons are configured in params.socialIcons (github, googlescholar, linkedin, orcid, openreview, dblp, alphaxiv, ...), the top menu in languages.en.menu.main.
Create <year>-<short-name>.md in content/pubs/:
---
title: "On the Electrodynamics of Moving Bodies"
date: 1905-06-30
authors: ["Your Name", "Coauthor1", "Coauthor2"]
equal_contributors: ["Your Name"] # equal contribution, marked with *
corresponding_authors: ["Coauthor2"] # corresponding author, marked with ✉
venue: "Annals of Physics"
abbr: "Ann. Phys."
topics: ["Relativity"] # grouping on the /pubs/ page
preview: "special_relativity.png" # image, put it in content/pubs/preview/
full_text: "https://en.wikisource.org/wiki/On_the_Electrodynamics_of_Moving_Bodies"
code: "https://github.com/<username>/<repo>"
selected: true # feature it under "Selected Publications" on the homepage
---
One-sentence summary (optional, shown below the title).Put the image in content/pubs/preview/ (a headless bundle that is never rendered as a page itself). The homepage also shows a legend explaining the bold name, * and ✉.
Create <date>-<short-name>.md in content/news/:
---
title: "Example News"
date: 2023-03-01
---
Write the news here; Markdown and links are supported.The homepage shows the 5 most recent items in reverse chronological order; the full list lives at /news/.
Create a .md file in content/blog/posts/. Add draft: true for drafts (excluded from the build by default; preview them locally with hugo server -D).
Pushing to the exampleSite branch triggers .github/workflows/gh-pages.yml: install Hugo extended 0.146.0 → fetch submodules → hugo --buildDrafts --gc --baseURL <Pages URL> → upload public/ and publish it to GitHub Pages. You can also trigger it manually from the Actions tab (with an optional Hugo version).
Note that the build command passes --buildDrafts, so drafts are published to the live site as well.
- Submodules must be initialized, otherwise Hugo reports missing themes/templates.
assets/vsstatic/: images that need Hugo processing (resizing, hashing) go toassets/; files that need a fixed URL (favicons,robots.txt) go tostatic/.content/news/**andcontent/pubs/**are set torender: never, list: localby thecascadeinconfig.yml— a single news item or publication is only a data source referenced by the homepage and the list pages, not a standalone page, so visiting its URL gives a 404. The list pages themselves (_index.md) are real pages, i.e./news/and/pubs/.content/about.mdis likewisebuild.render: never; its content is spliced into the homepage, so/about/is a 404 (the About menu entry points to/).params.env: productionenables Google Analytics, OpenGraph and image resizing; switch it todevelopmenttemporarily if you want to skip these while debugging locally.public/andresources/_gen/are build artifacts, already in.gitignore; do not commit them.- After the theme is updated you need to move the pointer in the site:
git pullthe latestmaininsidethemes/PaperMod-academic-patch, then commit the new submodule pointer at the repository root (CI checks out the pointer, it does not follow the latest commit automatically).
- GitHub Actions for auto-deploying to GitHub Pages
- More instructions in the README