How I add notes to this site
A quick reference (mostly to my future self) for adding a new note here, and how the Notes section indexes them automatically.
How notes are indexed
The Notes menu points at /posts/. I never edit a list of links by hand —
Hugo builds the index for me:
- The list page comes from
content/posts/_index.md. - Every folder under
content/posts/with anindex.mdbecomes one note. - Notes are sorted by the front-matter
date, newest first. tagsandcategoriesgenerate their own index pages (/tags/…,/categories/…).- Push to
main→ GitHub Actions rebuilds and deploys.
Steps to add a new note
Create a page bundle — a folder named after the URL slug, with an
index.mdinside:hugo new posts/tracking-research-trends/index.mdThis creates
content/posts/tracking-research-trends/index.md, which will be served at/posts/tracking-research-trends/.Fill in the front matter at the top of the file:
--- title: "Tracking trends in scientific research" date: 2026-06-11 draft: false author: "Xiaopeng Xu" description: "One-line summary shown in search and previews." tags: ["research-trends", "reading"] categories: ["Research"] toc: enable: true ---Write the body in markdown below the front matter.
Add a summary cut where the preview card should stop:
A short hook that shows on the Notes list and homepage. <!--more--> The full note continues here…Co-locate images in the same folder and reference them with a relative path (use a quoted title for a caption):
Preview locally, then publish by pushing to
main:hugo server -D # -D also shows drafts git add content/posts/tracking-research-trends git commit -m "post: tracking trends in scientific research" git push origin main
Front-matter cheatsheet
| Field | Purpose |
|---|---|
title | Shown as the heading and in the Notes list |
date | Controls sort order (newest first) |
draft | true hides it from the production build |
description | Used in search results and link previews |
tags / categories | Build /tags/… and /categories/… index pages |
toc.enable | Toggles the table of contents |
draft: true while writing — it stays out of the live site until you flip it
to false. Future-dated posts are also hidden until their date arrives.Pre-publish checklist
- Folder is
content/posts/<slug>/index.md -
draft: falseand a correctdate -
descriptionset (for search and previews) -
tags/categorieschosen - Images co-located and rendering
- Previewed locally, then pushed to
main
That’s the whole workflow — next up, notes like tracking trends in scientific research are just a new folder away.
Xiaopeng Xu