Search engines and link previews
A web build says what each page is and where it lives, so a search engine or a link preview can read it without running script (decision 0162). Three things are yours to write: a description per page, the levels of your headings, and the site's address.
A description per page
<screen title="Field Notes" description="Notes you can read and write offline.">
description is written into the page's file as its meta description and as the text a link preview shows. It is text in quotes: it is written before any script runs, so it cannot follow state (E0182). title is the page's title, as before.
Heading levels
<text role="heading" level="1">Field Notes</text>
<text role="heading" level="2">This week</text>
A heading with a level from "1" to "6" is written as <h1> to <h6> on the web, the outline search engines and screen readers read. Give each page one level 1 heading. Without a level a heading stays what it was, a level 2 heading to assistive technology. A level that is not "1" to "6", or on a text that is not a heading, is E0181. On iOS and Android the text is announced as a heading, as before; the level does not change it.
The site's address
# duolith.yaml
web:
url: https://notes.example.com
name: Field Notes
image: /card.png
| Setting | What it is |
|---|---|
url | The address the site is served from: http or https, a whole site, nothing after the host. Required when web is written. |
name | The site's name, shown beside a page's title in a link preview. |
image | The picture a link preview shows: the path of a file in public/. 1200 by 630 pixels suits every preview. |
With web, every route's file carries its canonical address and Open Graph tags, the home page says what the site is called, and the build writes sitemap.xml (every route without a parameter) and robots.txt (everything allowed, and where the sitemap is). A sitemap.xml or robots.txt of your own in public/ is used instead. Without web, none of these are written. A setting a crawler would misread stops the build (E0567).
Pages a crawler can read without script
A route whose files all fold onto rung 0 is written as HTML with no script at all; execution-ladder.md says which routes those are and how the build report names them. A route that needs the runtime still carries its title, description and address in its file, and its screens are built in the browser.
Related
- execution-ladder.md: written routes and the build report.
- production.md: the optimized build and the Content-Security-Policy.