Snippets about Stati

30 snippets

Back to all snippets

  1. SNP 148 #415

    A page for every tag in Stati

    One [tag].md template, URLs from Stati's slugify, and links that match them.

  2. SNP 147 #693

    Paginate a listing in Stati

    One line of front matter for numbered pages, and a pager built from stati.pagination.

  3. 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.

  4. 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.

  5. SNP 144 #A34

    Images in Stati Markdown and layouts

    Where image paths point, what Stati adds to the images, and stati.image() for covers.

  6. 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.

  7. SNP 135 #529

    Different config for dev and production in Stati

    getEnv() knows which command is running. NODE_ENV doesn't.

  8. SNP 130 #316

    Find the slowest pages in a Stati build

    Build metrics, the HTML report, and two jq one-liners.

  9. 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.

  10. 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.

  11. SNP 117 #235

    Keep Stati's build cache between CI runs

    Cache .stati and dist together, or the next build starts from nothing anyway.

  12. SNP 112 #61B

    ISG aging rules in Stati

    Rebuild new posts often and old ones rarely, and the catch on a static host.

  13. SNP 109 #942

    stati invalidate cheat sheet

    Clear Stati's build cache by tag, path, glob or age, and what each query really matches.

  14. SNP 105 #591

    Breadcrumbs from stati.nav

    getBreadcrumbs() starts at the page's own folder. findNode() gives the whole trail.

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. SNP 075 #3A1

    Callout boxes in Stati Markdown

    GitHub's > [!NOTE] syntax as a small markdown-it rule.

  23. SNP 073 #513

    Add markdown-it plugins to Stati

    Footnotes, containers and emoji, and the plugin that has to go through configure instead.

  24. SNP 069 #2B4

    Highlight code with Shiki in Stati

    Build-time syntax highlighting with Shiki, ready before Stati's synchronous markdown.configure runs.

  25. 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.

  26. SNP 063 #13B

    Class names with stati.propValue

    Stati's own classnames, for class lists with conditions in them.

  27. SNP 060 #495

    Custom template filters in Stati

    A date format and a reading time, registered once in the config and called like functions.

  28. 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.

  29. 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.

  30. SNP 050 #B14

    Eta tags in Stati templates

    The three tags, the one variable, and the comment that breaks a template.