Personal project

Personal website: a trilingual publishing machine

Hugo + Toha · Chinese / English / French

A Hugo-powered trilingual static site: a data-driven homepage, an academic archive where courses link to projects and competitions, project and competition detail pages, giscus comments, reading-progress and scroll motion, and a /cv/ generator that turns homepage data into an A4 PDF.

Why build my own

A template site can host a résumé, but I wanted content and layout fully separated: the same education, project and competition data should drive the homepage, the academic archive, the CV and the blog at once. Only your own build can do that.

The site started in April 2024 with a simple theme, later moved to Toha, and gradually turned the homepage, project pages, competition pages and the academic archive into data-driven layouts. Today it is a trilingual, backend-free portfolio that can be read end to end on a phone.

Making information easy to follow

The homepage is a résumé you can scroll

Rather than a wall of cards, the homepage follows a deliberate reading order: about → skills → experience → education → projects → competitions → links. Each section stands on its own, but read in sequence they form a complete introduction. Sections are ordered by a weight field, so rearranging them means changing a number.

Two levels: lists for overview, details for depth

Projects, competitions and the academic archive all use a list page plus detail pages:

  • the list page offers filter buttons (all / academic / programming / outreach) so the direction is legible at a glance;
  • detail pages share one template: breadcrumbs, title and summary, a fact sidebar (course, period, role), related articles, related skills and comments.

Visitors always know where they are and where they can go next.

One visual language

Colours, type sizes and spacing are shared across the site: ruled section headings, right-aligned dates with tabular numerals, subtle hover movement on cards. Dark mode is not a naive inversion — it redefines a set of CSS variables for overlays, text and borders separately.

Built with Hugo

  • Generator: Hugo (extended), deployed as pure static files — no backend;
  • Theme: Toha as the base, with layouts/ overrides for projects, competitions, the academic archive and the CV page;
  • Data: homepage sections and the academic archive live in data/ as YAML; templates only compose them;
  • Content: posts in Markdown with custom shortcodes (figures, quotes, video);
  • Assets: images resized by width, CSS and JS minified and fingerprinted through Hugo Pipes, so caches are always fresh.

The direct benefit: adding a course, a project or a photo is a data change, never a template change.

Things the site does

Academic archive

Each university has a complete course archive:

  • courses listed by term, with course code, grade, GPA and ECTS credits;
  • grades colour-coded by band (90+, 80–89, 70–79, below 70; A/B/C letter grades treated the same way);
  • course codes are anchors (e.g. #course-UR06), so project pages can link straight to a course;
  • courses, course projects and competitions cross-link, letting a transcript lead all the way to a drone competition page.

Project details

Every project page includes the course and period, my role, repository links (public repos are linked directly; the source repo stays private), related articles, related skills and a comment section. Related articles tie the technical write-ups of one project together.

Competition details

Competition pages emphasise results: awards, period and role at the top, followed by the background and my part, plus a certificate gallery where images open full size. Related articles appear at the bottom.

The homepage links section gathers GitHub, Gitee, CSDN, LeetCode, Luogu and LinkedIn. Contribution heatmaps and a recent-activity timeline show what I have been doing lately, rather than only static résumé entries.

Interaction and motion

Small details that keep reading comfortable:

  • a reading-progress bar fills at the top of the page while scrolling;
  • a back-to-top button fades in after 520px;
  • content blocks rise slightly into view via IntersectionObserver, and the system’s “reduce motion” preference disables all of it;
  • code blocks have a copy button that briefly confirms.

Comments

A purely static site has no server, so comments live in GitHub Discussions: giscus loads a single iframe. The comment theme follows the site’s light/dark switch, and posts, projects and competitions all accept comments.

CV generator

/cv/ is the heaviest page on the site: pick a language and entries, watch a paginated A4 preview, and export a clickable PDF. All content comes from the homepage YAML, and English/French versions automatically point internal links at the matching language pages. Implementation notes are in this article.

Three languages and deployment

The site exists in Chinese, English and French: translations sit side by side as *.en.md / *.fr.md, data lives under data/<lang>/, and Chinese-only navigation entries are labelled (Chinese) / (Chinois). First visits redirect by browser language — deliberately not by IP, because VPNs and travel make IPs lie.

Publishing splits across two repositories:

  • a private repository holds the Hugo sources and all content;
  • a public repository only receives build output: publish.ps1 rebuilds, squashes everything into a single commit and force-pushes.

The source repository is not public, but the published output and the comment data are:

Drafts and scripts never reach the public GitHub Pages repo, while source history stays complete.

Takeaways

The main lesson is that every convenient feature rests on disciplined data structures. Had the homepage been written as long HTML blocks, neither the academic cross-links, the CV generator nor the trilingual pages would exist.

The other lesson is engineering hygiene: build and deploy scripts, asset fingerprinting, and encoding pitfalls (Windows consoles, PowerShell, colons and ampersands in YAML) — each one recorded, and most written up as articles on this very site.

The site keeps growing: Chinese-aware full-text search, more CV layout templates, and yearly reading logs turned into a browsable timeline.

Technical notes

01 Building the site: Hugo configuration (Chinese) Starting a Hugo site from scratch: directories, configuration and the first templates. 02 Shortcodes, breadcrumbs and page structure (Chinese) Templating repeated content with shortcodes, and the trade-offs of breadcrumbs and tables of contents. 03 Asset caching and multilingual links (Chinese) Two pitfalls found while shipping the academic archive: local versus live differences and language-prefixed links. 04 Language redirects for a static site (Chinese) How first-visit redirects work on the trilingual site, and why IP geolocation was left out. 05 Comments on a static blog with giscus (Chinese) Giving a serverless site a comment section, and making it match the site theme. 06 Building a CV generator (Chinese) Embedding data, the safeJS pitfall, block-based A4 pagination and per-page jsPDF export.

Related skills

  • Hugo
  • Git