{
  "title": "Replacing a Public Linkding Instance with a Static Site",
  "date": "2026-11-01T12:00:00-07:00",
  "slug": "linkding-ssg",
  "type": "entry",
  "tags": [
    "linkding",
    "golang",
    "homelab",
    "selfhosting",
    "indieweb",
    "static-sites",
    "pagefind",
    "mastodon"
  ],
  "thumbnail": "/2026/11/01/linkding-ssg/jan-antonin-kolar-lRoX0shwjUQ-unsplash-dithered.png",
  "summary": "TL;DR: I stopped exposing my homelab's dynamic Linkding instance to the public internet via Tailscale. Instead, I built linkding-ssg, a self-contained Go CLI that snapshots my 35,000 bookmarks into a fast static site with client-side Pagefind search—embedded binaries, Ivy Bridge quirks, and all.",
  "draft": false,
  "comments_archived": false,
  "year": "2026",
  "month": "11",
  "day": "01",
  "postName": "2026-11-01-linkding-ssg",
  "isDir": true,
  "path": "2026/11/01/linkding-ssg",
  "body": "\n**TL;DR**: I stopped exposing my homelab's dynamic Linkding instance to the public internet via Tailscale. Instead, I built [linkding-ssg](https://github.com/lmorchard/linkding-ssg), a self-contained Go CLI that snapshots my 35,000 bookmarks into a fast static site with client-side Pagefind search—embedded binaries, Ivy Bridge quirks, and all.\n\n\u003c!--more--\u003e\n\n\u003cfigure class=\"wide\"\u003e\n\u003cimg src=\"./jan-antonin-kolar-lRoX0shwjUQ-unsplash-dithered.png\" alt=\"Vintage wooden library card catalog drawers with brass pulls and label plates\"\u003e\n\u003cfigcaption\u003e\nPhoto by \u003ca href=\"https://unsplash.com/@jankolar?utm_source=unsplash\u0026utm_medium=referral\u0026utm_content=creditCopyText\"\u003eJan Antonin Kolar\u003c/a\u003e on \u003ca href=\"https://unsplash.com/photos/brown-wooden-drawer-lRoX0shwjUQ?utm_source=unsplash\u0026utm_medium=referral\u0026utm_content=creditCopyText\"\u003eUnsplash\u003c/a\u003e\n\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cnav role=\"navigation\" class=\"table-of-contents\"\u003e\u003c/nav\u003e\n\n## Hosting overkill\n\nI’ve been running [Linkding](https://linkding.link/) in my homelab for a while now to collect bookmarks. It’s a great app—clean UI, snappy, and it plays nicely with the rest of my [feed reading Rube Goldberg machine](https://blog.lmorchard.com/2026/08/22/vanishing-feeds/). And, until tonight, I had my cloud VPS reverse-proxying `links.lmorchard.com` directly back into my home network over Tailscale so anyone on the web could browse my links.\n\nIt was neat \u0026 clever to set up, but I realized how silly it was.\n\nI’m the only person who adds, tags, or edits bookmarks in this collection. Why was I exposing a dynamic Django application to the public internet, tunneling inbound web traffic straight into my home server, and fretting over bots abusing my search form—when it's all essentially read-only anyway?\n\nIf my home internet hiccups or my Proxmox server reboots, my public links shouldn't vanish. And flat files served by Caddy with zstd/gzip compression will run circles around a dynamic backend. \n\nPlus, having a static snapshot means my archive—stretching all the way back to del.icio.us imports from 2003—lives locally in a clean, portable format, independent of whether Linkding itself survives the next decade.\n\nThis isn't the first time I've gone down this road, either. I built [fossilizer](https://github.com/lmorchard/fossilizer) with a similar mindset: collecting all my Mastodon posts across multiple servers and years, turning them into a searchable static archive over at [old-toots.lmorchard.com](https://old-toots.lmorchard.com/).\n\nThere's something deeply satisfying about \"fossilizing\" your personal data out of ephemeral web apps into permanent, resilient static files.\n\nSo, I built [linkding-ssg](https://github.com/lmorchard/linkding-ssg): a standalone Go CLI that pulls bookmarks from Linkding's REST API, snapshots them to JSON, and builds a fully searchable static archive.\n\n## The scale (isn't really a) problem\n\nI've got over 35,000 bookmarks. A lot of static site generators fall over when you throw that much at them.\n\nThe usual `/page/N/` pagination is especially toxic for large static archives: adding five new bookmarks at the top shifts the boundaries of *every single page* on the entire site. That means thousands of file modifications on every build, cache invalidations across the board, and massive `rsync` deltas.\n\nTo keep the site fast and the files mostly immutable, I settled on a **temporal + sharded** structure:\n\n\u003cfigure class=\"code-block\"\u003e\n\n```\ndist/\n├── index.html                   # Recent bookmarks (latest 50) + RSS link\n├── feed.xml                     # RSS 2.0 feed of recent bookmarks\n├── archive/\n│   ├── index.html               # 25-year timeline grid linking to months\n│   ├── 2026/10/index.html       # Monthly archive (immutable once past)\n│   └── 2003/09/index.html\n├── tags/\n│   ├── index.html               # All 9,100+ tags sorted by frequency\n│   └── webdev/\n│       ├── index.html           # Tag listing\n│       └── feed.xml             # Scoped RSS feed for #webdev\n├── b/\n│   └── 038/38825/index.html     # Sharded canonical permalinks (/b/{shard}/{id}/)\n├── about/index.html             # Rendered from custom markdown in data/pages/\n└── pagefind/                    # Client-side full-text search index \u0026 UI\n```\n\n\u003c/figure\u003e\n\n### Cool URLs don't change\nOnce a month is in the past (like September 2003 or May 2018), that page is frozen. Incremental updates only touch `index.html`, `feed.xml`, the current month, and newly added bookmarks.\n\n### Directory sharding\nDumping 35,000 directories in a single folder can cause filesystem headaches. Sharding bookmark permalinks by ID bucket (`/b/038/38825/`) caps any single folder to at most 1,000 subdirectories.\n\n## Static site search with Pagefind\n\nA static bookmark collection without search is almost useless. I first discovered [Pagefind](https://pagefind.app/) while building client-side search for this blog (which is also a static site). It builds compact, chunked search indices and executes queries inside a Web Worker in the browser without needing a dynamic search backend.\n\nHowever, I wanted `linkding-ssg` to be a **completely standalone Go binary** running on a minimal Linux VM—without dragging along Node.js, `npm`, or `npx`.\n\nPagefind's indexer is written in Rust and publishes standalone `musl` binaries for Linux and macOS. To make the CLI 100% self-contained:\n- I embedded Pagefind's compressed binaries directly into the Go binary using Go build tags (`//go:build linux \u0026\u0026 amd64`, `//go:build darwin \u0026\u0026 arm64`).\n\n- Go's compiler only embeds the binary matching the target platform, adding just ~4.5 MB to the executable.\n\n- When running `linkding-ssg build --index`, the CLI extracts Pagefind to `data/bin/pagefind` on first run and executes it directly. Zero external runtime dependencies.\n\n### A fun hardware discovery\n\nWhen I first deployed the standalone binary to my Proxmox server, Pagefind immediately crashed with: `signal: illegal instruction (core dumped)`\n\nThe server runs an Intel Core i7-3770 (Ivy Bridge, released in 2012). Checking `/proc/cpuinfo` revealed the processor supports `avx` and `sse4_2`, but lacks `avx2` and `bmi1/bmi2` (which Intel didn't introduce until Haswell in 2013). Pagefind's v1.6.0 release was compiled targeting `x86-64-v3` (AVX2), tripping illegal instruction traps on Ivy Bridge.\n\nDropping back to Pagefind v1.5.2—which was compiled for the standard `x86-64-v2` baseline—fixed the crash immediately while retaining the full Web Component search UI.\n\n## Speedy site generation\n\nThe scale here is just a little bit gratuitous. But, it's just files, and computers can go really fast with files these days.\n\nGenerating **44,000 HTML pages**, **9,100 tag pages**, and **9,100 RSS feeds** sequentially took around 57 seconds on a single core.\n\nBecause each bookmark card and tag page is completely independent, and Go's `html/template` parse tree is read-only and thread-safe during execution, this was trivially parallelizable. \n\nI added a bounded worker pool defaulting to `runtime.NumCPU()` (or `--concurrency`):\n- **Tag pages \u0026 tag RSS feeds**: 38s → 10s\n- **35,000 bookmark permalinks**: 14s → 5s\n- **Total build time**: **~20 seconds** to generate 53,000 files.\n\n## Deployment\n\nThe sync pipeline between my home server and the cloud VPS is dead simple:\n\n\u003cfigure\u003e\n\u003cmermaid-diagram\u003e\ngraph TD\n  A[\"Linkding Container\u003cbr\u003e(localhost:19090)\"] --\u003e|\"1. linkding-ssg sync\"| B[\"Local Snapshot \u0026 Build\u003cbr\u003edata/bookmarks.json + dist/\"]\n  B --\u003e|\"2. rsync via SSH / rrsync\"| C[\"Cloud VPS (aerostat02)\u003cbr\u003e/srv/www/links.lmorchard.com\"]\n  C --\u003e|\"3. Caddy HTTPS static serve\"| D[\"Public Visitors\"]\n\u003c/mermaid-diagram\u003e\n\u003cfigcaption\u003e\n  The linkding-ssg build and deployment pipeline\n\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n1. **Incremental Sync**: `linkding-ssg sync` queries the Linkding REST API (`/api/bookmarks/`). Because Linkding serves bookmarks newest-first, the CLI stops fetching as soon as it sees an ID already present in the local `data/bookmarks.json`. It merges edits, builds the HTML, and runs Pagefind.\n\n2. **Restricted `rrsync` Deploy**: On my cloud VM (`aerostat02`), Caddy serves `/srv/www/links.lmorchard.com`. The deployment uses an SSH key confined via OpenSSH `command=\"/usr/bin/rrsync /srv/www/links.lmorchard.com\",restrict`. The key cannot spawn a shell or forward ports into my network; it can only write files to that one folder.\n\n3. **Automated via Makefile**: A simple Makefile on the home server ties it together:\n\n   \u003cfigure class=\"code-block\"\u003e\n\n   ```makefile\n   publish:\n       ./linkding-ssg sync\n       rsync -rltvz --delete --omit-dir-times \\\n           -e \"ssh -i ~/.ssh/id_ed25519\" \\\n           dist/ \\\n           webdeploy@aerostat02.lmorchard.com:\n   ```\n\n   \u003c/figure\u003e\n\nA cron job runs `make publish` hourly.\n\n## Headless homelab, static web\n\nThis setup scratches a lot of personal itches:\n\n- **Self-hosting doesn't mean everything needs to be a public web app**: Treating dynamic applications as headless CMSs inside the LAN while publishing static output publicly gives you the best of both worlds. The editing UX stays interactive, but the public surface is bulletproof, fast, and un-hackable.\n\n- **Embedded single binaries are great**: Packaging default templates, styles, and external CLI tools inside one Go binary makes deployments onto minimal Linux containers painless.\n\n- **Old hardware is still plenty capable**: A 12-year-old Ivy Bridge box in a closet can index 35,000 documents and push a static site across the internet in under two minutes without breaking a sweat.\n\nYou can check out the source on GitHub at [lmorchard/linkding-ssg](https://github.com/lmorchard/linkding-ssg), and browse the live result at [links.lmorchard.com](https://links.lmorchard.com/).\n",
  "html": "\u003cp\u003e\u003cstrong\u003eTL;DR\u003c/strong\u003e: I stopped exposing my homelab\u0026#39;s dynamic Linkding instance to the public internet via Tailscale. Instead, I built \u003ca href=\"https://github.com/lmorchard/linkding-ssg\"\u003elinkding-ssg\u003c/a\u003e, a self-contained Go CLI that snapshots my 35,000 bookmarks into a fast static site with client-side Pagefind search—embedded binaries, Ivy Bridge quirks, and all.\u003c/p\u003e\n\u003c!--more--\u003e\n\u003cfigure class=\"wide\"\u003e\n\u003cimg src=\"./jan-antonin-kolar-lRoX0shwjUQ-unsplash-dithered.png\" alt=\"Vintage wooden library card catalog drawers with brass pulls and label plates\"/\u003e\n\u003cfigcaption\u003e\nPhoto by \u003ca href=\"https://unsplash.com/@jankolar?utm_source=unsplash\u0026amp;utm_medium=referral\u0026amp;utm_content=creditCopyText\"\u003eJan Antonin Kolar\u003c/a\u003e on \u003ca href=\"https://unsplash.com/photos/brown-wooden-drawer-lRoX0shwjUQ?utm_source=unsplash\u0026amp;utm_medium=referral\u0026amp;utm_content=creditCopyText\"\u003eUnsplash\u003c/a\u003e\n\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cnav role=\"navigation\" class=\"table-of-contents\"\u003e\u003c/nav\u003e\n\u003ch2 id=\"hosting-overkill\"\u003eHosting overkill\u003c/h2\u003e\n\u003cp\u003eI’ve been running \u003ca href=\"https://linkding.link/\"\u003eLinkding\u003c/a\u003e in my homelab for a while now to collect bookmarks. It’s a great app—clean UI, snappy, and it plays nicely with the rest of my \u003ca href=\"https://blog.lmorchard.com/2026/08/22/vanishing-feeds/\"\u003efeed reading Rube Goldberg machine\u003c/a\u003e. And, until tonight, I had my cloud VPS reverse-proxying \u003ccode\u003elinks.lmorchard.com\u003c/code\u003e directly back into my home network over Tailscale so anyone on the web could browse my links.\u003c/p\u003e\n\u003cp\u003eIt was neat \u0026amp; clever to set up, but I realized how silly it was.\u003c/p\u003e\n\u003cp\u003eI’m the only person who adds, tags, or edits bookmarks in this collection. Why was I exposing a dynamic Django application to the public internet, tunneling inbound web traffic straight into my home server, and fretting over bots abusing my search form—when it\u0026#39;s all essentially read-only anyway?\u003c/p\u003e\n\u003cp\u003eIf my home internet hiccups or my Proxmox server reboots, my public links shouldn\u0026#39;t vanish. And flat files served by Caddy with zstd/gzip compression will run circles around a dynamic backend.\u003c/p\u003e\n\u003cp\u003ePlus, having a static snapshot means my archive—stretching all the way back to del.icio.us imports from 2003—lives locally in a clean, portable format, independent of whether Linkding itself survives the next decade.\u003c/p\u003e\n\u003cp\u003eThis isn\u0026#39;t the first time I\u0026#39;ve gone down this road, either. I built \u003ca href=\"https://github.com/lmorchard/fossilizer\"\u003efossilizer\u003c/a\u003e with a similar mindset: collecting all my Mastodon posts across multiple servers and years, turning them into a searchable static archive over at \u003ca href=\"https://old-toots.lmorchard.com/\"\u003eold-toots.lmorchard.com\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eThere\u0026#39;s something deeply satisfying about \u0026#34;fossilizing\u0026#34; your personal data out of ephemeral web apps into permanent, resilient static files.\u003c/p\u003e\n\u003cp\u003eSo, I built \u003ca href=\"https://github.com/lmorchard/linkding-ssg\"\u003elinkding-ssg\u003c/a\u003e: a standalone Go CLI that pulls bookmarks from Linkding\u0026#39;s REST API, snapshots them to JSON, and builds a fully searchable static archive.\u003c/p\u003e\n\u003ch2 id=\"the-scale-isnt-really-a-problem\"\u003eThe scale (isn\u0026#39;t really a) problem\u003c/h2\u003e\n\u003cp\u003eI\u0026#39;ve got over 35,000 bookmarks. A lot of static site generators fall over when you throw that much at them.\u003c/p\u003e\n\u003cp\u003eThe usual \u003ccode\u003e/page/N/\u003c/code\u003e pagination is especially toxic for large static archives: adding five new bookmarks at the top shifts the boundaries of \u003cem\u003eevery single page\u003c/em\u003e on the entire site. That means thousands of file modifications on every build, cache invalidations across the board, and massive \u003ccode\u003ersync\u003c/code\u003e deltas.\u003c/p\u003e\n\u003cp\u003eTo keep the site fast and the files mostly immutable, I settled on a \u003cstrong\u003etemporal + sharded\u003c/strong\u003e structure:\u003c/p\u003e\n\u003cfigure class=\"code-block\"\u003e\n\u003cpre\u003e\u003ccode\u003edist/\n├── index.html                   # Recent bookmarks (latest 50) + RSS link\n├── feed.xml                     # RSS 2.0 feed of recent bookmarks\n├── archive/\n│   ├── index.html               # 25-year timeline grid linking to months\n│   ├── 2026/10/index.html       # Monthly archive (immutable once past)\n│   └── 2003/09/index.html\n├── tags/\n│   ├── index.html               # All 9,100+ tags sorted by frequency\n│   └── webdev/\n│       ├── index.html           # Tag listing\n│       └── feed.xml             # Scoped RSS feed for [#webdev](/tag/webdev)\n├── b/\n│   └── 038/38825/index.html     # Sharded canonical permalinks (/b/{shard}/{id}/)\n├── about/index.html             # Rendered from custom markdown in data/pages/\n└── pagefind/                    # Client-side full-text search index \u0026amp; UI\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/figure\u003e\n\u003ch3 id=\"cool-urls-dont-change\"\u003eCool URLs don\u0026#39;t change\u003c/h3\u003e\n\u003cp\u003eOnce a month is in the past (like September 2003 or May 2018), that page is frozen. Incremental updates only touch \u003ccode\u003eindex.html\u003c/code\u003e, \u003ccode\u003efeed.xml\u003c/code\u003e, the current month, and newly added bookmarks.\u003c/p\u003e\n\u003ch3 id=\"directory-sharding\"\u003eDirectory sharding\u003c/h3\u003e\n\u003cp\u003eDumping 35,000 directories in a single folder can cause filesystem headaches. Sharding bookmark permalinks by ID bucket (\u003ccode\u003e/b/038/38825/\u003c/code\u003e) caps any single folder to at most 1,000 subdirectories.\u003c/p\u003e\n\u003ch2 id=\"static-site-search-with-pagefind\"\u003eStatic site search with Pagefind\u003c/h2\u003e\n\u003cp\u003eA static bookmark collection without search is almost useless. I first discovered \u003ca href=\"https://pagefind.app/\"\u003ePagefind\u003c/a\u003e while building client-side search for this blog (which is also a static site). It builds compact, chunked search indices and executes queries inside a Web Worker in the browser without needing a dynamic search backend.\u003c/p\u003e\n\u003cp\u003eHowever, I wanted \u003ccode\u003elinkding-ssg\u003c/code\u003e to be a \u003cstrong\u003ecompletely standalone Go binary\u003c/strong\u003e running on a minimal Linux VM—without dragging along Node.js, \u003ccode\u003enpm\u003c/code\u003e, or \u003ccode\u003enpx\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003ePagefind\u0026#39;s indexer is written in Rust and publishes standalone \u003ccode\u003emusl\u003c/code\u003e binaries for Linux and macOS. To make the CLI 100% self-contained:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eI embedded Pagefind\u0026#39;s compressed binaries directly into the Go binary using Go build tags (\u003ccode\u003e//go:build linux \u0026amp;\u0026amp; amd64\u003c/code\u003e, \u003ccode\u003e//go:build darwin \u0026amp;\u0026amp; arm64\u003c/code\u003e).\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eGo\u0026#39;s compiler only embeds the binary matching the target platform, adding just ~4.5 MB to the executable.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eWhen running \u003ccode\u003elinkding-ssg build --index\u003c/code\u003e, the CLI extracts Pagefind to \u003ccode\u003edata/bin/pagefind\u003c/code\u003e on first run and executes it directly. Zero external runtime dependencies.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 id=\"a-fun-hardware-discovery\"\u003eA fun hardware discovery\u003c/h3\u003e\n\u003cp\u003eWhen I first deployed the standalone binary to my Proxmox server, Pagefind immediately crashed with: \u003ccode\u003esignal: illegal instruction (core dumped)\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eThe server runs an Intel Core i7-3770 (Ivy Bridge, released in 2012). Checking \u003ccode\u003e/proc/cpuinfo\u003c/code\u003e revealed the processor supports \u003ccode\u003eavx\u003c/code\u003e and \u003ccode\u003esse4_2\u003c/code\u003e, but lacks \u003ccode\u003eavx2\u003c/code\u003e and \u003ccode\u003ebmi1/bmi2\u003c/code\u003e (which Intel didn\u0026#39;t introduce until Haswell in 2013). Pagefind\u0026#39;s v1.6.0 release was compiled targeting \u003ccode\u003ex86-64-v3\u003c/code\u003e (AVX2), tripping illegal instruction traps on Ivy Bridge.\u003c/p\u003e\n\u003cp\u003eDropping back to Pagefind v1.5.2—which was compiled for the standard \u003ccode\u003ex86-64-v2\u003c/code\u003e baseline—fixed the crash immediately while retaining the full Web Component search UI.\u003c/p\u003e\n\u003ch2 id=\"speedy-site-generation\"\u003eSpeedy site generation\u003c/h2\u003e\n\u003cp\u003eThe scale here is just a little bit gratuitous. But, it\u0026#39;s just files, and computers can go really fast with files these days.\u003c/p\u003e\n\u003cp\u003eGenerating \u003cstrong\u003e44,000 HTML pages\u003c/strong\u003e, \u003cstrong\u003e9,100 tag pages\u003c/strong\u003e, and \u003cstrong\u003e9,100 RSS feeds\u003c/strong\u003e sequentially took around 57 seconds on a single core.\u003c/p\u003e\n\u003cp\u003eBecause each bookmark card and tag page is completely independent, and Go\u0026#39;s \u003ccode\u003ehtml/template\u003c/code\u003e parse tree is read-only and thread-safe during execution, this was trivially parallelizable.\u003c/p\u003e\n\u003cp\u003eI added a bounded worker pool defaulting to \u003ccode\u003eruntime.NumCPU()\u003c/code\u003e (or \u003ccode\u003e--concurrency\u003c/code\u003e):\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003eTag pages \u0026amp; tag RSS feeds\u003c/strong\u003e: 38s → 10s\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e35,000 bookmark permalinks\u003c/strong\u003e: 14s → 5s\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eTotal build time\u003c/strong\u003e: \u003cstrong\u003e~20 seconds\u003c/strong\u003e to generate 53,000 files.\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2 id=\"deployment\"\u003eDeployment\u003c/h2\u003e\n\u003cp\u003eThe sync pipeline between my home server and the cloud VPS is dead simple:\u003c/p\u003e\n\u003cfigure\u003e\n\u003cmermaid-diagram\u003e\ngraph TD\n  A[\u0026#34;Linkding Container\u003cbr/\u003e(localhost:19090)\u0026#34;] --\u0026gt;|\u0026#34;1. linkding-ssg sync\u0026#34;| B[\u0026#34;Local Snapshot \u0026amp; Build\u003cbr/\u003edata/bookmarks.json + dist/\u0026#34;]\n  B --\u0026gt;|\u0026#34;2. rsync via SSH / rrsync\u0026#34;| C[\u0026#34;Cloud VPS (aerostat02)\u003cbr/\u003e/srv/www/links.lmorchard.com\u0026#34;]\n  C --\u0026gt;|\u0026#34;3. Caddy HTTPS static serve\u0026#34;| D[\u0026#34;Public Visitors\u0026#34;]\n\u003c/mermaid-diagram\u003e\n\u003cfigcaption\u003e\n  The linkding-ssg build and deployment pipeline\n\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eIncremental Sync\u003c/strong\u003e: \u003ccode\u003elinkding-ssg sync\u003c/code\u003e queries the Linkding REST API (\u003ccode\u003e/api/bookmarks/\u003c/code\u003e). Because Linkding serves bookmarks newest-first, the CLI stops fetching as soon as it sees an ID already present in the local \u003ccode\u003edata/bookmarks.json\u003c/code\u003e. It merges edits, builds the HTML, and runs Pagefind.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eRestricted \u003ccode\u003errsync\u003c/code\u003e Deploy\u003c/strong\u003e: On my cloud VM (\u003ccode\u003eaerostat02\u003c/code\u003e), Caddy serves \u003ccode\u003e/srv/www/links.lmorchard.com\u003c/code\u003e. The deployment uses an SSH key confined via OpenSSH \u003ccode\u003ecommand=\u0026#34;/usr/bin/rrsync /srv/www/links.lmorchard.com\u0026#34;,restrict\u003c/code\u003e. The key cannot spawn a shell or forward ports into my network; it can only write files to that one folder.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eAutomated via Makefile\u003c/strong\u003e: A simple Makefile on the home server ties it together:\u003c/p\u003e\n\u003cfigure class=\"code-block\"\u003e\n\u003cpre\u003e\u003ccode class=\"language-makefile\"\u003epublish:\n    ./linkding-ssg sync\n    rsync -rltvz --delete --omit-dir-times \\\n        -e \u0026#34;ssh -i ~/.ssh/id_ed25519\u0026#34; \\\n        dist/ \\\n        webdeploy@aerostat02.lmorchard.com:\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/figure\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eA cron job runs \u003ccode\u003emake publish\u003c/code\u003e hourly.\u003c/p\u003e\n\u003ch2 id=\"headless-homelab-static-web\"\u003eHeadless homelab, static web\u003c/h2\u003e\n\u003cp\u003eThis setup scratches a lot of personal itches:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eSelf-hosting doesn\u0026#39;t mean everything needs to be a public web app\u003c/strong\u003e: Treating dynamic applications as headless CMSs inside the LAN while publishing static output publicly gives you the best of both worlds. The editing UX stays interactive, but the public surface is bulletproof, fast, and un-hackable.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eEmbedded single binaries are great\u003c/strong\u003e: Packaging default templates, styles, and external CLI tools inside one Go binary makes deployments onto minimal Linux containers painless.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eOld hardware is still plenty capable\u003c/strong\u003e: A 12-year-old Ivy Bridge box in a closet can index 35,000 documents and push a static site across the internet in under two minutes without breaking a sweat.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eYou can check out the source on GitHub at \u003ca href=\"https://github.com/lmorchard/linkding-ssg\"\u003elmorchard/linkding-ssg\u003c/a\u003e, and browse the live result at \u003ca href=\"https://links.lmorchard.com/\"\u003elinks.lmorchard.com\u003c/a\u003e.\u003c/p\u003e\n",
  "sourceFile": "content/posts/2026/2026-11-01-linkding-ssg/index.md",
  "parentPath": "content/posts/2026/2026-11-01-linkding-ssg",
  "attachments": [
    "./jan-antonin-kolar-lRoX0shwjUQ-unsplash-dithered.png"
  ],
  "prevPostPath": "2026/10/19/the-only-conscious-observer",
  "prevPostTitle": "The Only Conscious Caretaker",
  "nextPostPath": "2026/11/02/w45",
  "nextPostTitle": "Pod chrysalises, basement forges, and cat gremlins (Catching up: September 21 – November 2)"
}