Background and Strategy
- First of all I want my Digital Garden to shared the same philosophy with my Second Brain – using plain-text Mardown storing in Git
- I choose Hugo over Astro.build or any other Static Site Generator (SSG)
- it is simple and fast (convert thousands of pages in seconds)
- I don’t need to install anything to use Hugo
- but even if I need, it is only a single pre-compiled portable package only, no dependency nightmare
- its “Page Bundles” works just like my “Resources” in my Second Brain
- its “Taxanomies” and “Related Content” is like tagging and graph links in my Second Brain
- using PaperMod theme since it prioritize simplicity, speed, and supports both light and dark theme
- I can host it for free (utilizing free-tier plan) with Cloudflare/Netlify/Azure without complex configuration
- the host can handle build and publish automatically after I perform a git commit
- I have decided to host it on Cloudflare
- Pages
- build, deploy and host my Hugo-built site by connecting to Git
- unlimited bandwidth
- allowed custom domain up to
100 - limitation
500builds per month- total number of files cannot exceed
20,000 - each file size cannot exceed
25 MB
- Pages Functions
- executing code on the Cloudflare network with Cloudflare Workers
- can handle authenticating, form submissions, or working with middleware
- D1 / Workers KV
- I haven’t decide on this yet
- D1 is a SQLite database, while Workers KV is a key/value data storage that allows you to store and retrieve data globally
- Pages
Checklist
Phase 1 - The Infrastructure (The Plot)
- Iitialize Git: Create a private GitHub repo
- Map PARA: set up your 4 main folders (1_Projects, 2_Areas, 3_Resources, 4_Archives)
- install Hugo: install Hugo locally on your machine at
C:\Users\___\AppData\Local\Programs\hugo_0.160.1and append it to yourENVIRONMENT PATH - Nest the Garden: Create your Hugo site
hugo new site PLOT --format yaml - Add PaperMod: Download PaperMod theme
hugo-PaperMod-8.0.zipand extract intoPLOT/themes/PaperMod, add:theme: PaperModinhugo.yml - Create
.gitignore: Ensurepublic/andresources/are ignored at the repo root.gitignore# 1. Main Build Artifacts (Never commit) /public/ /resources/ /.hugo_build.lock # 2. Local Assets Caches (Optional but highly recommended) /resources/ # 3. Environment & Dynamic Config Tracking /assets/jsconfig.json /hugo_stats.json *.log # OS-specific files (Windows & macOS) desktop.ini Thumbs.db .DS_Store
Phase 2 - Configuration (The Soil)
- Configure hugo.yaml: Set your name, base URL, title, and theme to PaperMod
hugo.yamlbaseURL: http://thethinker.pages.dev/ locale: en-us title: The Thinker theme: PaperMod params: # Author name Author: The Thinker
- Uses Page Bundles: Ensure posts are organized in a folder with
index.md, e.g./posts/my-first-post/index.md - Setup Taxonomies: Define tags as your primary way to organize topics
hugo.yaml# enable taxanomies and define tags as the primary way to organize topics taxonomies: tag: tags # add Tags to Navigation menu: main: - name: Tags url: /tags/ weight: 10content/tags/_index.md--- title: "Tags" description: "Explore my posts by tags" layout: "terms" ---
- Define Related Content: Add the “scoring” weights to your config to automate relationships
hugo.yaml# add the "scoring" weights to automate relationships # Exact Match: If two posts share the same keyword, they get 100 points. # Multiple Matches: If they share two tags, they get 80 + 80 = 160 points. # Threshold: If the total score is below your threshold, the post won't be suggested. related: threshold: 80 # Only show posts with a score higher than this includeNewer: true # Show posts newer than the current one toLower: true # Case-insensitive matching indices: - name: keywords weight: 100 # Matches in "keywords" are top priority - name: tags weight: 80 # Matches in "tags" are very important - name: categories weight: 50 - name: date weight: 10 # Boosts posts published around the same timelayouts/partials/related.html{{ $related := .Site.RegularPages.Related . | first 3 }} {{ with $related }} <h3>See also</h3> <ul> {{ range . }} <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{ end }} </ul> {{ end }}- copy
themes/PaperMod/layouts/_default/single.htmltoPLOT/layouts/_default/single.html, and add the following new footer{{ partial "related.html" . }}
- Enable Search: Configure the PaperMod search index so your garden is navigable
content/search/index.md--- title: "Search" description: "Explore my posts by searching them" layout: "search" # This tells PaperMod to use its search template summary: "search" placeholder: "Search for posts..." ---hugo.yaml# enable Search outputs: home: - HTML - RSS - JSON # This is the critical part for search # Add Search to Navigation menu: main: - name: Search url: /search/ weight: 10 # Search related configuration params: fuseOpts: isCaseSensitive: false shouldSort: true location: 0 # the starting point distance: 1000 # how far away from the Location a match can be threshold: 0.4 # The "fuzziness" or strictness of the match. Scale: 0.0 (perfect match only) to 1.0 (match anything) minMatchCharLength: 0 keys: ["title", "permalink", "summary", "content"]
- Enable
ShowBreadCrumbsand disableShowLastModin the confighugo.ymlparams: # Enable Breadcrumbs above post titles ShowBreadCrumbs: true # Disable "Last Modified" date on posts ShowLastMod: false
- Configure the Homepage
hugo.yaml# Using Home-Info Mode: use 1st entry as some Information homeInfoParams: Title: Title here bla Content: Content here bla bla bla.
- Create an About page
hugo.yamlmenu: main: - name: About url: /about/ weight: 10content/about/index.md--- title: "About" ShowBreadCrumbs: false ShowLastMod: false ShowReadingTime: false ShowWordCount: false ShowTOC: false --- your About content...
- Enable Table of Contents
hugo.yamlparams: ShowTOC: true TocOpen: true
- Always let Hugo render links by itself; by doing this the markdown links work across editor and live site; refer to https://gohugo.io/configuration/markup/#renderhookslinkuseembedded
hugo.yamlmarkup: goldmark: renderHooks: link: useEmbedded: always
Phase 3 - The Harvest Workflow (The Irrigation)
- Identify a Seedling: Pick a folder from
PARAthat is “ready enough” to share - Move to Garden: Drag the folder into
PLOT/content/posts/ - Standardize Name: Rename the main file to
index.md - Clean Attachments: Ensure images used are inside the same folder
- Frontmatter Ritual: Add title, date, tags: [“seedling”], and draft: false
- Local Review: Run
hugo server -Dand check your work atlocalhost:1313
Phase 4 - The Publishing Pipeline (The Planting)
- Cloudflare Setup: Log in to the
Cloudflare Dashboard, navigate toWorkers & Pages, clickCreate application>Pages, and link your private GitHub repo - Configure Build Settings: Select the
Hugoframework preset, set the build command tohugo, and ensure the buildoutput directoryis set topublic, also set theRoot directoryexplicitly toPLOT - Configure Environment Variables: Add
HUGO_VERSION(0.160.1) andGO_VERSION(1.22.0or higher) in theEnvironment variables (advanced)section - Apply Path Filtering: configure Cloudflare’s
Build watch paths>Include paths:toPLOT/*and it will only trigger builds when changes occur inside thePLOTdirectory
Phase 5 - Trending the Garden (Growth)
- The Commit: Use Git to commit and push your changes to your repository
- Verify Build: Check the
Workers & Pagestab in your Cloudflare Dashboard to confirm that your build successfully passed and wasn’t skipped by your folder filter rule - Monitor Cloudflare: Visit your
*.pages.devproduction URL to see your published notes in the wild - Cross-Link: Ensure links from your private
PARAnotes to your publicPLOTnotes to build your local graph works