Content Structure in Recipe Repositories
How Notepub templates organize page types, homepage, hubs, search, and links between notes.
This page explains the baseline content model for templates:
notepub-recipe-blognotepub-recipe-docs
Page types in recipe templates
Both recipe templates follow the same core type model:
home- homepage (/)page- regular page (/{{ slug }}/in docs recipe,/{{ slug }}/for page in blog recipe)article- article (in blog recipe usually/articles/{{ slug }}/, in docs recipe/{slug}/)hub- topic section/hub pagesearch- search page (/search/)
Minimal required frontmatter fields:
typeslugtitle
In docs portal template (np), language-specific types are used (home_en, article_en, hub_ru, etc.), but the model is the same.
How homepage works
home is a special single page type at route /.
Recipe validation expects exactly one page of this type (and exactly one search as well).
Homepage usually shows:
- article/page collections
- list of hubs
- featured content cards (in blog recipe)
Block composition is controlled by collections in rules.yaml and template home.html.
How hubs work
hub is a section page that receives content through frontmatter links.
Baseline mechanism:
- in page/article, set
hub: ["some-hub"] belongs_tolink rule connects content to hub byslughub_itemscollection builds hub page items
Result: hub pages are assembled automatically when hub is filled correctly.
How pages and articles work
In practice:
pageis usually for static sections (about, contacts, landing pages)articleis the primary stream of notes/docs
What goes into search and sitemap is defined in rules.yaml:
- usually search includes
pageandarticle home,hub,searchare usually excluded from search index
How search works
Recipe templates include a dedicated search page and search rules in rules.yaml.
Typical setup:
- search index is built from
pageandarticle - draft content is excluded (
exclude_drafts: true) - snippet is taken from
description(preview.from: "description")
So for predictable results, fill description.
How relations and links work
Recipe templates usually have three relation kinds:
belongs_to- membership in hubs viahubrelated- manual links viarelatedwiki- wiki-links in markdown body (double-bracket wikilink syntax)
For wikilink syntax, aliases, and resolver order, see: Links and Wikilinks
Practical modeling pattern for notes
If you want to use your own markdown-world structure:
- Define top-level hub pages first.
- Attach articles to hubs via
hub. - Add
relatedonly where explicit editorial relation is needed. - Fill
titleanddescriptionfor each note to improve search quality. - Keep
slugstable; when changed, add redirects.