Repository structure

community mirrored publictxt docs spec

How a PublicTxt repository is laid out, following the PublicTxt-Pages content structure. The format specification adopts the same layout (§4) and front matter (§5); it is the formal version of this page.

_index.md                  home page
wiki/                      reference pages, read by place
  _index.md                a folder's own page (any depth)
blog/                      dated posts; the date comes from the path
  2023/12/17/post.md         day folder
  2024/09/20240922-title.md  YYYYMMDD prefix
  20260509-title.md          YYYYMMDD prefix, no folders
posts/                     longer pieces
notes/                     short notes
bookmarks/
  sites/<domain>/page.md   one file per web resource, with a `bookmark:` URL
  wiki/topic.md            pages about bookmarks (no URL needed)
media/                     shared images and audio, copied as-is
settings/site.toml         site settings for PublicTxt-Pages (optional)
follows/repo.md            one note per repo you follow: `url` in front matter (ADR-0014)
community/repo/…           mirrors: pages from a repo you follow, as written there (ADR-0017)
.github/workflows/         the publish workflow

Never published: CNAME, .gitignore, .obsidian/. README.md, LICENSE and CONTRIBUTING.md are published as ordinary pages; to keep them (or any other file name) off, list them in params.skipFiles in settings/site.toml. The list replaces the default, so repeat CNAME and .gitignore.

Collections

Each top-level folder is a collection (and a section of the site). A page can join others:

  • collections: [blog] in front matter — listed under Blog too, wherever it’s filed
  • a bookmark: URL — joins bookmarks, wherever it lives

Collections add, never replace: a page always stays in its folder’s collection.

Front matter

All optional; the build derives the rest.

KeyPurpose
titleFalls back to an # H1 that is the first non-empty line of the body, then the filename
tagsMerged with inline #hashtags
collectionsExtra collections
bookmark / bookmarksThe URL(s) the page is about
created / updatedOverride dates from the path and Git history
publish: offLeave the page off the site (it’s still public in the repo)
  • Link with relative Markdown links: [text](../wiki/page.md). [[wikilinks]] show as plain text.
  • Put images beside the note, or in a top-level folder like media/.

Changing a rule here? Change the format specification first (ADR-0013); PublicTxt-Pages follows.