Page
Page is the full HTML document for a page, with its title, its initial signals, and the runtime.
Page
Page::render evaluates every binding with the initial signals, so the first HTML already contains the values the runtime would compute.
| Item | Summary |
|---|---|
Page::new | Starts a page with its title and initial signal values. |
child | Appends a node to <body>. |
on_key | Runs stmt when shortcut is pressed anywhere on the page. |
computed | Keeps signal equal to value, recomputed when a signal value reads changes. |
bind_title | Keeps the document's title, the text of the browser tab, equal to title. |
theme | Sets token values for the whole page. |
global | Adds rules for elements by their tag, and fonts, to the page. |
style | Adds sheet to <head> as a <style> block. |
stylesheet | Adds a <link rel="stylesheet"> for the file at href to <head>. |
script | Adds a <script type="module"> for the file at src to <head>. |
lang | Sets the language of the page, the lang attribute of <html>, to the BCP 47 tag tag. |
runtime_src | Loads the runtime from src instead of RUNTIME_PATH, for a page served as a static file. |
csp_nonce | Puts nonce on the page's <style> and <script> elements, for a Content-Security-Policy that allows styles by nonce. |
render | Renders the document. |
value_of | The value signal starts at in the browser, for a test of a page handler. |
RUNTIME_PATH | The path Page loads the runtime from, which names a hash of RUNTIME_JS. |
RUNTIME_JS | The browser runtime, built from runtime/ in the repository. |
Search results and link previews
A canonical URL and the image of a card are absolute, so they join a path to an Origin. Navigation loads the next document, so each page writes its own tags.
| Item | Summary |
|---|---|
description | Sets the summary of the page that search results and link previews show. |
canonical | Names url on origin as the page's one address. |
alternate | Names url on origin as the same page in the language hreflang. |
alternate_default | Names url on origin as the version for a visitor whose language no alternate matches. |
noindex | Asks search engines to leave the page out of their results. |
nofollow | Asks search engines not to follow the links on the page. |
framed_by | Lets pages served from origin show this page in a frame. |
framed_anywhere | Lets a page of any site show this page in a frame. |
json_ld | Adds data to <head> as JSON-LD, the structured data search engines read. |
icon | Uses the file at href as the page's icon in tabs and bookmarks. |
open_graph | Adds the card a link to the page shows in chat apps and social sites. |
Origin | The scheme, host, and optional path prefix a site is served from. |
Origin::under | The same origin with the site served under prefix, such as /blog. |
Origin::parse | Reads an origin and an optional prefix from configuration, such as https://example.com/blog. |
OriginError | Text that Origin::parse refused, with the rule it broke. |
OpenGraph | The card a chat app or a social site shows for a link to the page. |
OpenGraphType | What a page shows, the og:type of its OpenGraph card. |
OpenGraphLocale | A language and territory in the ja_JP form that og:locale takes. |