Tutorial · Part 6 of 7

SEO

One config block and a per-page override, and the whole head is handled.

  1. Turn metadata on

    One block in kirigami.yaml, fine empty:

    
                                    seo:
                                      jsonld: {}
                                

    seo: derives <title>, the description, Open Graph, Twitter Card, the canonical link, and the favicon tags from the kirigami: block plus each page's PHPDOC — nothing to write by hand in header.php. The nested jsonld: does the same for a schema.org <script type="application/ld+json"> block — its own independent opt-in, so a project can skip it and keep just the <head> tags. Drop favicon.ico and apple-touch-icon.png in src/ and they're picked up automatically.

  2. Override per page

    A page's own PHPDOC wins over the project-wide defaults:

    
                                    /**
                                     * @title           The first pleat
                                     * @meta_description How Studio Plié got its name.
                                     * @meta_image      images/fold-01.jpg
                                     */
                                

    A tag header.php already writes by hand is detected and left alone — seo: fills gaps, it never duplicates.

  3. Check the sitemap

    Every build with prepros: set regenerates sitemap.xml at kirigami.root, one <url> per rendered page, from kirigami.baseurl — nothing to maintain by hand as pages get added or removed.


NOTE

This whole site runs on exactly this one block — every page you've read in this tutorial got its title, description and social card the same way, straight from its own PHPDOC. It goes one step further for its favicon and og:image: since it already has the image pipeline wired up, seo.favicon / seo.appleTouchIcon / seo.image point at generated files instead of ones dropped in by hand — see Docs → Config → seo for that option.