PaperMod Hugo Dev
Overview
Guide for developing, fixing, and styling this PaperMod-based Hugo site. Covers content workflows, configuration, feature toggles, custom layout/SEO overrides, and validation.
Quick Start
- Prereq: Hugo Extended v0.147+ (
hugo versionshould includeextended). - Dev:
hugo server -D(includes drafts) at http://localhost:1313; published-only:hugo server. - Build check:
hugo --gc --minifybefore handoff to catch template/front matter issues. - Generated outputs: avoid editing
public/andresources/; theme overrides live inlayouts/andassets/.
Repo Map (local)
hugo.yaml: site + PaperMod params (menus, defaultTheme, search outputs, etc.).content/posts/: main section (Page Bundles recommended)..drafts/holds scratch notes; move intocontent/posts/to publish.archetypes/default.md: default front matter.layouts/shortcodes/articleCount.html: counts non-draft pages inparams.mainsections(used on homepage).layouts/partials/header.html: custom fixed nav + theme toggle; rendersSite.Menus.main.layouts/partials/extend_head.html: fonts, OG/Twitter meta, canonical, defaultimages/OG_IMAGE.png.layouts/partials/footer.html+extend_footer.html: footer links, Cabin analytics, a11y font scale/contrast, theme persistence.layouts/_default/list.html: tweaked list layout, breadcrumbs, pagination;layouts/_default/_markup/render-image.html: lazy<img>render hook.assets/css/extended/custom.css: brand gradient, nav/footer, code block styling, Quicksand font; bundled by Hugo assets pipeline.
Content Workflow
- New post (file):
hugo new posts/my-post.md; Page Bundle:hugo new posts/my-post/index.mdthen add images alongsideindex.mdand reference./image.png. - Recommended front matter:
--- author: ["Chris Achinga"] title: "Post Title" date: "2025-01-01" description: "One-line summary" tags: ["tag1", "tag2"] ShowToc: true TocOpen: true draft: true images: ["/images/og/cover.png"] # for cards cover: image: "/images/headers/cover.png" alt: "Alt text" caption: "Caption" --- - Publish by setting
draft: false. Keep content types aligned withparams.mainsections(posts,papermod).
Configuration & Feature Toggles
- Edit
hugo.yaml:- Menus:
languages.en.menu.main. - Defaults:
params.defaultTheme,ShowShareButtons,ShowReadingTime,ShowPostNavLinks,ShowBreadCrumbs,ShowCodeCopyButtons,ShowToc,ShowPageNums,ShowAllPagesInArchive, etc. - Home:
homeInfoParamsgreeting uses{{< articleCount >}}; toggleprofileModefor full-profile landing. - Search:
outputs.homealready includes JSON; create/adjustcontent/search.mdfor the search page. - Archives page: add
content/archives.mdwithlayout: archives. - Social icons:
params.socialIcons. - SEO/social:
params.description,params.author,imagesdefault array;extend_headusesimages/OG_IMAGE.pngif not overridden. - Full PaperMod switches live in
references/papermod-features.md(covers, editPost links, comments, access keys, Fuse options, etc.).
- Menus:
- Comments: drop provider embed in
layouts/partials/comments.html, then setparams.comments: true.
Styling & Layout
- CSS overrides: edit
assets/css/extended/custom.css(palette, nav/footer, code blocks, font). Hugo rebuilds the bundle on serve/build. - Header nav: adjust
layouts/partials/header.htmlif menu/toggle behavior changes (theme button storespref-themeinlocalStorage). - Footer + a11y:
layouts/partials/footer.htmlandextend_footer.htmlmanage font scaling, contrast, theme persistence; keep the expected IDs (font-smaller,font-reset,font-bigger,contrast-toggle,theme-toggle) if you add controls. - Images:
layouts/_default/_markup/render-image.htmlemits lazy<img>with async decoding. - Shortcodes:
articleCountshows total published posts in main sections.
SEO/Analytics
params.env: productionenables PaperMod enhanced SEO;extend_headadds meta/OG/Twitter and canonical tags. Override images/titles via front matter (images,cover,description).- Analytics: Google Analytics supported via
params.analytics.google; Cabin script already loaded infooter.html.
Debugging & Checks
- Confirm Hugo Extended availability:
hugo version. - If builds fail, run
hugo --gc --minifyfor validation; fix front matter (YAML, lowerCamel keys) and missing params. - Avoid editing generated
public/output; regenerate viahugo --minifywhen needed.
References
- PaperMod feature toggles and examples:
references/papermod-features.md. - Formatting examples:
content/posts/formatting-posts-on-hugo.md. - Project quick start and commands:
README.md.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.