HugoPortfolioBlog

hugo-xpage — Hugo Portfolio Template

By Jensen-JZ

hugo-xpage is a Hugo theme in black, white, and electric yellow, aimed at personal homepages and technical blogs, supporting English, Simplified Chinese, and Traditional Chinese content blocks with on-demand loading of KaTeX, Mermaid, and Prism.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

1 previews
Author preview
Author-provided previewTop of page

Preview provided in the project README.

One original preview is available. Open the full image to inspect the design.

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

Black, white, and electric-yellow color scheme with a square-design contract and a custom crosshair cursor

02

Client-side switching of English, Simplified Chinese, and Traditional Chinese content via lang-block containers

03

5 image and diagram shortcodes: image-size, image-grid, image-carousel, live-photo, mermaid

04

Prism, KaTeX, and Mermaid loaded on demand; pages without corresponding content do not include these scripts

05

Click-to-lightbox images, Live Photo hover playback, theme switching, search modal, and back-to-top

06

Outputs Open Graph, Twitter Card, canonical, sitemap, RSS, and robots.txt

Template Details

hugo-xpage is a Hugo theme for building personal sites and technical blogs. Visually it uses three colors—black, white, and electric yellow—and emphasizes square design: no border-radius except for navigation pills, a custom crosshair cursor, images that open a lightbox on click, and Live Photos that play on hover with a LIVE badge.

For multilingual support, the theme switches English, Simplified Chinese, and Traditional Chinese content on the client side via `<div class="lang-block">` containers. Body text must be wrapped separately per language, and the default language block is marked with data-active="true". The homepage is a single-page long layout with sections including hero, about, what-do, journey, projects, writing, photography, and contact, driven by 8 TOML files under exampleSite/data; the article list and detail pages share the same i18n mechanism.

For content capabilities, it provides 5 shortcodes: image-size, image-grid, image-carousel, live-photo, and mermaid. Prism syntax highlighting, KaTeX math formulas, and Mermaid diagrams are all loaded on demand; pages without math, diagrams, or code do not include the corresponding scripts. For SEO, it outputs Open Graph, Twitter Card, canonical, sitemap, RSS, and robots.txt, and provides a 1200×630 OG card.

Usage limitations: the article frontmatter conventions are strict, and listing and i18n depend on these fields; inline math requires double-backslash escaping `\\(...\\)`, otherwise Goldmark will swallow the parentheses; Mermaid has known conflicts with multilingual blocks and Prism's language-X class name matching, which the theme has handled, but care is needed when modifying related logic. Prism, KaTeX, and Mermaid are loaded on demand from jsdelivr, with no bundler and no npm install required.

HugoPortfolioBlog

Is it right for your project?

Use Cases

  • Building a personal homepage or portfolio with multilingual content
  • Writing technical blogs with code highlighting, math formulas, and Mermaid diagrams
  • Showcasing photography with image grids, carousels, and Live Photo hover playback
  • Sites that need Chinese-English or Simplified-Traditional Chinese switching

Suitable For

  • Individual developers or writers building static sites with Hugo
  • Sites that need to switch between English, Simplified Chinese, and Traditional Chinese content
  • Portfolio or photography pages that primarily express through images and diagrams
  • Sites that prefer a square, high-contrast editorial visual style

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Clone the theme into the site's themes/ directory and set theme = "hugo-xpage" in hugo.toml

  2. 2

    Copy the [params] block from exampleSite/hugo.toml into your own configuration and replace placeholders such as author, domain, and OG image

  3. 3

    Homepage sections are driven by 8 TOML files under exampleSite/data and need to be edited according to your own content

  4. 4

    Interface text is centralized in data/i18n.toml; replace by section under [en]/[zh]/[tw]

  5. 5

    Article body text must be wrapped in three lang-block containers for each language, and follow the frontmatter field conventions of the example articles

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean that external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Prism, KaTeX, and Mermaid are all loaded on demand from the jsdelivr CDN, so the site depends on an external CDN service at runtime; when offline or unable to access jsdelivr, these highlighting, formula, and diagram features are unavailable.
  • Fonts come from Google Fonts and the system font stack, which are external third-party resources; confirm their licenses and availability before use.
  • Example article copy is placeholder content and can be freely deleted; demo assets such as OG cards in the example site need to be replaced with your own content.
  • Demo images, fonts, icons, and other third-party assets need to be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domain, hosting, database, payment, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

All three are loaded from jsdelivr. No bundler. No npm install.

Original README

Inter / Newsreader / JetBrains Mono — typefaces (Google Fonts + system stack)

Original README

The example post copy is placeholder text and free to delete.

Original README
https://github.com/Jensen-JZ/hugo-xpage/blob/main/LICENSEhttps://github.com/Jensen-JZ/hugo-xpage/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 88 / 100
Technologies
Hugo
Website type
Portfolio · Blog
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-05-07
Screenshot last checked
2026-10-02

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Hugo as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: 6bf63b550f128be6124fbd031e92c4783b56fb660d68ccf7cb3e35674e6dcdc8

2026-10-02T14:14:40.260Z

Source file / repository
# hugo-xpage

A black, white, and electric-yellow Hugo theme for personal sites and technical blogs.
Multilingual (en / 简体中文 / 繁體中文) lang-blocks switched client-side. Five image
shortcodes plus on-demand KaTeX, Mermaid, and Prism syntax highlighting that load only
when a page actually uses them. Square-design contract — no rounded chrome buttons,
custom crosshair cursor, click-to-lightbox on every image, Live Photo with hover-play.

![hugo-xpage homepage screenshot](images/screenshot.png)

> Live demo: [peritrix.com](https://peritrix.com).

---

## Demo

```bash
git clone https://github.com/Jensen-JZ/hugo-xpage.git
cd hugo-xpage/exampleSite
hugo server -D --bind 127.0.0.1 --port 1313 --disableFastRender
# → http://localhost:1313/
```

The exampleSite ships two posts:
- `hello-world.md` — minimal multilingual post template
- `feature-showcase.md` — exercises every block (Markdown, Prism, KaTeX, Mermaid, all 5 shortcodes)

---

## Install in your own site

The theme works the standard Hugo way: clone into `themes/` and reference it in your config.

```bash
# from the root of your Hugo site
mkdir -p themes
git submodule add https://github.com/Jensen-JZ/hugo-xpage.git themes/hugo-xpage
```

Then in your `hugo.toml`:

```toml
theme = "hugo-xpage"
```

That's it. Copy the contents of `exampleSite/data/`, `exampleSite/content/`, and the `[params]` block from `exampleSite/hugo.toml` into your own site as a starting point.

---

## What you get

| Feature | Status |
|---|---|
| Multilingual posts via `<div class="lang-block">` (en / zh / tw) | ✓ |
| Single-page portfolio layout (hero · about · what-do · journey · projects · writing · photography · contact) | ✓ |
| Long-form blog with multilingual lang-blocks | ✓ |
| Full SEO surface — OG, Twitter Card, canonical, sitemap, RSS, robots.txt | ✓ |
| Open Graph card (1200×630) | ✓ |
| 5 shortcodes — `image-size`, `image-grid`, `image-carousel`, `live-photo`, `mermaid` | ✓ |
| On-demand Prism.js syntax highlighting (only loads if the page has fenced code) | ✓ |
| On-demand KaTeX (only if `$$ … $$` or `\\(…\\)` exists on the page) | ✓ |
| On-demand Mermaid v10 (only if `<pre class="mermaid">` exists) | ✓ |
| Click-to-lightbox on every image | ✓ |
| Live Photo hover-to-play with LIVE badge | ✓ |
| Custom crosshair cursor + theme switcher + search modal + back-to-top | ✓ |
| Square-design contract — no `border-radius` outside chrome nav pills | ✓ |
| 404 page (branded) | ✓ |

A blank-content page with no math, no diagrams, no code stays at zero JS dependencies.

---

## Project layout

```
hugo-xpage/
├── archetypes/              # default.md
├── assets/                  # bundled JS/CSS (theme assets)
├── i18n/                    # Hugo i18n hook (real i18n lives in exampleSite/data/i18n.toml)
├── layouts/
│   ├── _default/
│   │   ├── single.html      # post template
│   │   └── list.html        # listing template
│   ├── index.html           # homepage (long single-page)
│   ├── 404.html
│   ├── partials/
│   │   ├── chrome/          # nav · rail · lightbox · search · seo · ...
│   │   ├── sections/        # homepage sections (hero/about/whatdo/...)
│   │   ├── post-styles/     # _article.css · _shortcodes.css (inlined)
│   │   └── post-scripts/    # _base.js · _shortcodes.js · _codeblock.js · _mermaid.js
│   └── shortcodes/
│       ├── image-size.html
│       ├── image-grid.html
│       ├── image-carousel.html
│       ├── live-photo.html
│       └── mermaid.html
├── static/
│   ├── assets/site-header.css   # 20 KB — single CSS source-of-truth
│   ├── assets/live/             # 6 demo Live Photo .mov + .jpg pairs
│   └── favicon.ico
├── theme.toml
├── LICENSE
└── exampleSite/
    ├── hugo.toml            # placeholder values — copy [params] into your own
    ├── content/posts/
    │   ├── hello-world.md
    │   └── feature-showcase.md
    ├── data/                # 8 toml files driving the homepage sections
    │   ├── about.toml
    │   ├── identity.toml
    │   ├── whatdo.toml
    │   ├── journey.toml
    │   ├── projects.toml
    │   ├── photography.toml
    │   ├── social.toml
    │   └── i18n.toml        # all UI strings in 3 languages
    └── static/assets/
        └── og-card.png      # demo OG card — replace with your own
```

---

## Authoring posts

The frontmatter convention is rigid because the listing/i18n machinery depends on it.
Use `exampleSite/content/posts/hello-world.md` as the canonical template.

```yaml
---
title: "Post Title"
slug: post-slug
date: '2026-01-01T00:00:00+00:00'
weight: 1
postId: post-slug
i18nKey: post.slug.title
categoryI18n: cat.notes      # cat.research / cat.tech / cat.travel / cat.lifestyle / cat.notes
dateDisplay: 2026·01·01
bylineDate: 2026 · 01 · 01
kickers:                     # eyebrow text per language
  en: NOTES · 2026
  zh: 笔记 · 2026
  tw: 筆記 · 2026
readTimes:
  en: 1 min read
  zh: 阅读约 1 分钟
  tw: 閱讀約 1 分鐘
heroCaption: F · 001 · KEY
titles:                      # per-language H1
  en: "..."
  zh: "..."
  tw: "..."
decks:                       # SEO description + listing deck
  en: "..."
  zh: "..."
  tw: "..."
prev: { href: /posts/X.html, title: "← Previous title" }
next: { href: /posts/Y.html, title: "Next title →" }
lastmod: '2026-01-01T00:00:00+00:00'
---
```

The body must be wrapped in three `<div class="lang-block" data-lang="en|zh|tw">`
containers, with `data-active="true"` on the default. The runtime in
`partials/post-scripts/_base.html` toggles visibility on language switch.

### Shortcodes

| Block               | Syntax                                                                                              |
|---------------------|------------------------------------------------------------------------------------------------------|
| Single image        | `{{</* image-size src="…" alt="…" caption="…" center="true" */>}}`                                    |
| Image grid          | `{{</* image-grid columns="2" gap="1rem" images="src1\|\|cap1, src2\|\|cap2" */>}}`                    |
| Image carousel      | `{{</* image-carousel width="90%" center="true" autoplay="false" caption="…" images="s1, s2, s3" */>}}` |
| Live Photo          | `{{</* live-photo src="img.png" video="vid.mov" width="60%" caption="…" center="true" */>}}`           |
| Mermaid diagram     | `{{</* mermaid caption="…" */>}}` … `{{</* /mermaid */>}}`                                            |
| Math (inline)       | `\\(\\nabla_\\theta \\mathcal{L}\\)`                                                                  |
| Math (display)      | `$$ … $$`                                                                                            |
| Code with highlight | Standard fenced ` ``` `lang `… ` ``` `                                                                |

### Drafts

Add `draft: true` to the frontmatter. Local preview with `hugo server -D`. Production build (`hugo --gc --minify`) skips drafts automatically.

---

## Configuration

Copy the `[params]` block from `exampleSite/hugo.toml` into your own site's `hugo.toml`:

```toml
[params]
  author          = 'Your Full Name'
  authorFamiliar  = 'You'
  handle          = '@yourhandle'
  email           = '[email protected]'
  domain          = 'example.com'
  homepageURL     = 'https://example.com'
  description     = 'A short description for SEO and social cards.'
  ogImage         = 'https://example.com/assets/og-card.png'
  twitterHandle   = '@yourhandle'
  # … plus hero / chrome / copy fields — see exampleSite/hugo.toml for the full set
```

All UI strings live in `data/i18n.toml` (one section per language). Replace the
copy in each `[en]` / `[zh]` / `[tw]` block to translate the entire site.

The 8 `data/*.toml` files drive the homepage sections — about rows, identity
fields, what-I-do columns, journey timeline, projects, photography frames,
contact links. Edit them to match your own content.

---

## Design contracts (gotchas worth knowing)

The theme has a few opinionated behaviors that are easy to break if you don't
know they exist:

- **`<mark>` padding is 0.** The yellow swipe must hug the glyph; any padding obscures the previous character.
- **No `cursor: pointer`.** Custom crosshair for chrome, `cursor: zoom-in` for images, native pointer only inside the lightbox.
- **No `border-radius: 999px`** outside chrome nav pills. All buttons are square.
- **CJK-safe heading anchors.** The slugifier in `_base.html` keeps non-ASCII characters and dedupes IDs.
- **Goldmark eats `\(`.** When writing inline math, escape with double backslash `\\(...\\)`. Single `\(...\)` would render as literal `(...)`.
- **Mermaid + multi-language collision.** Three identical diagrams in three `lang-block` clones cause v10 to fail on duplicate node IDs. The loader renders only the active `lang-block` and re-renders on language switch — this is already handled.
- **Prism `language-X` regex collision.** The autoloader's class regex matches both `language-X` and `lang-X`, so `<div class="lang-block">` would trigger a 404 for a phantom `prism-block.min.js`. Suppressed by `Prism.manual = true` and explicit `Prism.highlightElement` calls — already handled.

---

## External CDN dependencies (loaded on demand)

The theme is HTML-first. JavaScript only loads when the page actually needs it:

- `[email protected]` — `prism-core` + autoloader + `prism-tomorrow.css`
- `[email protected]` — `katex.min.js` + `auto-render.min.js` + `katex.min.css`
- `[email protected]` — `mermaid.esm.min.mjs`

All three are loaded from jsdelivr. No bundler. No npm install.

---

## Deployment

The exampleSite produces a 5–6 MB `public/` of plain static files. Deploy anywhere:

```bash
hugo --gc --minify
# rsync, Cloudflare Pages, Vercel, GitHub Pages, Netlify — pick any
rsync -avz public/ user@host:/var/www/site/
```

---

## License & credits

MIT — see [LICENSE](LICENSE).

Runtime libraries (loaded from jsdelivr):

- [Hugo](https://gohugo.io) (BSD-3) — static site generator
- [Prism.js](https://prismjs.com) (MIT) — syntax highlighting
- [KaTeX](https://katex.org) (MIT) — math typesetting
- [Mermaid](https://mermaid.js.org) (MIT) — diagrams
- Inter / Newsreader / JetBrains Mono — typefaces (Google Fonts + system stack)

The theme code is © 2026 Jensen-JZ. Demo Live Photo clips bundled with the
theme are CC0 / generated. The example post copy is placeholder text and free
to delete.

If you build something with this, I'd love to see it — file an issue or PR
to add it to a "made with hugo-xpage" list.
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.