Hugo PaperMod: Make Affiliate Disclosure Configurable Per Post

This post shows how to make affiliate disclosure configurable per post in the Hugo theme PaperMod. On this blog, I used to write the disclosure directly in the article body when disclosure was required. However, copying and pasting the text every time was a hassle, so I made it easy to configure with an article parameter. Environment Windows 11 / Git Bash Hugo v0.164.0 / works with the standard build as well PaperMod v8.0 / using the latest commit at the time of writing $ hugo version hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended windows/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio $ cd themes/PaperMod && git log -1 --oneline 154d006 (HEAD -> master, origin/master, origin/HEAD) style(post-single): adjust padding for details summary element Installation steps 1. Create a custom layout Copy themes/PaperMod/layouts/single.html to layouts/single.html. ...

2026-07-23

Hugo PaperMod: Change Language Switch UI to W3C-Recommended Native Language Labels

This post shows how to change the language switch UI of the Hugo theme PaperMod to use W3C-recommended native language labels (日本語/English). The default PaperMod setting displays language codes (Ja/En), which contradicts the W3C best practice shown below. When providing links to pages in other languages, use the name of the target language in the native language and script. ...

2026-07-22

Hugo PaperMod: Sort Post List by Last Modified Date

This post explains how to change the sort order of the post list in the PaperMod theme for Hugo to descending order by last modified date. For blogs like this one that frequently update existing posts, the last modified date is a better representation of the latest state than the original publication date. Environment Windows 11 / Git Bash Hugo v0.164.0 / Standard build compatible PaperMod v8.0 / Latest commit as of writing $ hugo version hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended windows/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio $ cd themes/PaperMod && git log -1 --oneline 154d006 (HEAD -> master, origin/master, origin/HEAD) style(post-single): adjust padding for details summary element Setup Steps 1. Add a custom layout Copy themes/PaperMod/layouts/list.html to create layouts/list.html. ...

2026-07-20

Hugo PaperMod: Display Post Last Modified Date

This article shows how to display the last modified date for posts in Hugo PaperMod. Since Hugo PaperMod is minimalist-oriented, there is no setting to display the last modified date. Furthermore, because the PR to the upstream repository was rejected, instead of waiting for an unlikely official implementation, we will implement it using a custom layout. Incidentally, displaying the last modified date serves as an important signal to Help Google Search know the best date for your web page | Google Search Central Blog | Google for Developers, providing implementation benefits from an SEO perspective as well, not just for the readers’ sake. ...

2026-07-15

Hugo PaperMod: Add Link Card Shortcode

This post explains how to add a link card styled to match Hugo PaperMod as a Shortcode for use in posts. It also covers adding a Node.js script that automatically generates link cards from OGP metadata of a given URL, since filling in OGP data manually is tedious. Environment Windows 11 / Git Bash Hugo v0.164.0 / Standard build compatible PaperMod v8.0 / Latest commit as of writing Node v24.18.0 $ hugo version hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended windows/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio $ cd themes/PaperMod && git log -1 --oneline 154d006 (HEAD -> master, origin/master, origin/HEAD) style(post-single): adjust padding for details summary element $ node -v v24.18.0 Setup 1. Add the Link Card Shortcode When styles are written directly in HTML in Hugo, CSS gets duplicated each time the same component is used multiple times on a page. To avoid this, the implementation splits HTML and CSS into separate files. ...

2026-07-15

Hugo PaperMod: Reduce Mobile Font Size

Hugo PaperMod uses text that is too large on smartphones by default, so I adjust it with custom CSS. Reference: Bundling Custom css with theme’s assets | FAQs · adityatelange/hugo-PaperMod Wiki Environment Windows 11 / Git Bash Hugo v0.164.0 / Standard build compatible PaperMod v8.0 / Latest commit as of writing $ hugo version hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended windows/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio $ cd themes/PaperMod && git log -1 --oneline 154d006 (HEAD -> master, origin/master, origin/HEAD) style(post-single): adjust padding for details summary element Setup Steps 1. Create the custom CSS Create assets/css/extended/custom.css. ...

2026-07-13