Snippets about Stati
30 snippets
-
SNP 148
#415
A page for every tag in Stati
One [tag].md template, URLs from Stati's slugify, and links that match them.
-
SNP 147
#693
Paginate a listing in Stati
One line of front matter for numbered pages, and a pager built from stati.pagination.
-
SNP 146
#924
Design your own link preview card in Stati
An og.eta that Satori can draw, a font of your own, and the rules it holds you to.
-
SNP 145
#1B3
List a section's posts anywhere in Stati
The newest posts on the home page from one line of front matter, and prev/next links without a hook.
-
SNP 144
#A34
Images in Stati Markdown and layouts
Where image paths point, what Stati adds to the images, and stati.image() for covers.
-
SNP 141
#241
Fail CI when a Stati build falls back
A broken config, layout or partial still exits with 0. Two greps catch them.
-
SNP 135
#529
Different config for dev and production in Stati
getEnv() knows which command is running. NODE_ENV doesn't.
-
SNP 130
#316
Find the slowest pages in a Stati build
Build metrics, the HTML report, and two jq one-liners.
-
SNP 126
#A25
Pages from a CMS in Stati
Write the CMS's posts as Markdown before the build starts. A hook is too late.
-
SNP 121
#471
Compute page data in beforeAll, not beforeRender
A Stati hook that writes front matter in beforeRender makes those pages rebuild on every build.
-
SNP 117
#235
Keep Stati's build cache between CI runs
Cache .stati and dist together, or the next build starts from nothing anyway.
-
SNP 112
#61B
ISG aging rules in Stati
Rebuild new posts often and old ones rarely, and the catch on a static host.
-
SNP 109
#942
stati invalidate cheat sheet
Clear Stati's build cache by tag, path, glob or age, and what each query really matches.
-
SNP 105
#591
Breadcrumbs from stati.nav
getBreadcrumbs() starts at the page's own folder. findNode() gives the whole trail.
-
SNP 101
#B63
Dynamic Tailwind classes in Stati
A class built from a variable never reaches Tailwind's scanner, unless stati.propValue() writes it down.
-
SNP 098
#42A
Load a script only on some pages in Stati
Stati's TypeScript bundles with include and exclude, and how their patterns match.
-
SNP 093
#9B5
Search a Stati site in the browser
Stati writes the search index at build time. A few dozen lines of TypeScript search it.
-
SNP 089
#26B
Keep a page out of search engines in Stati
noindex, the sitemap and the site's own search, from the page's front matter and one config line.
-
SNP 085
#349
An RSS feed for one folder in Stati
Why contentPatterns needs a **/ in front, and the link Stati doesn't add for you.
-
SNP 081
#152
Your own title format with Stati's SEO tags
Write the <title> yourself and let Stati fill in the rest of the head.
-
SNP 078
#A47
A nested table of contents in Stati
stati.page.toc is a flat list. A few lines of Eta turn it into nested lists.
-
SNP 075
#3A1
Callout boxes in Stati Markdown
GitHub's > [!NOTE] syntax as a small markdown-it rule.
-
SNP 073
#513
Add markdown-it plugins to Stati
Footnotes, containers and emoji, and the plugin that has to go through configure instead.
-
SNP 069
#2B4
Highlight code with Shiki in Stati
Build-time syntax highlighting with Shiki, ready before Stati's synchronous markdown.configure runs.
-
SNP 066
#742
Serve Stati's clean URLs from nginx
/about is about.html. The try_files line, the trailing slash redirect and the 404 page.
-
SNP 063
#13B
Class names with stati.propValue
Stati's own classnames, for class lists with conditions in them.
-
SNP 060
#495
Custom template filters in Stati
A date format and a reading time, registered once in the config and called like functions.
-
SNP 057
#641
Pick a layout per page in Stati
How Stati finds a page's layout, and the typo it won't tell you about.
-
SNP 053
#359
Partials with props in Stati
A card component that takes data, and the one line that keeps it from breaking every page.
-
SNP 050
#B14
Eta tags in Stati templates
The three tags, the one variable, and the comment that breaks a template.