Contents

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 an index.md becomes one note.
  • Notes are sorted by the front-matter date, newest first.
  • tags and categories generate their own index pages (/tags/…, /categories/…).
  • Push to main → GitHub Actions rebuilds and deploys.

Steps to add a new note

  1. Create a page bundle — a folder named after the URL slug, with an index.md inside:

    hugo new posts/tracking-research-trends/index.md

    This creates content/posts/tracking-research-trends/index.md, which will be served at /posts/tracking-research-trends/.

  2. 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
    ---
  3. Write the body in markdown below the front matter.

  4. 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…
  5. Co-locate images in the same folder and reference them with a relative path (use a quoted title for a caption):

    ![Trend overview](trend-overview.png "Publications per year in my field.")
  6. 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

FieldPurpose
titleShown as the heading and in the Notes list
dateControls sort order (newest first)
drafttrue hides it from the production build
descriptionUsed in search results and link previews
tags / categoriesBuild /tags/… and /categories/… index pages
toc.enableToggles the table of contents
Drafts and dates
Set 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: false and a correct date
  • description set (for search and previews)
  • tags / categories chosen
  • 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.