tilder, Documentation, Reference, Feeds and images

Documentation

Name

feeds-and-images - RSS, iCalendar, icons, the link preview and the manifest

Besides the pages, the build writes the files that other programs read: an RSS feed per collection that asks for one, in every language; an iCalendar file for events; the icons and the link preview, drawn from SVG at every build; and the web manifest. None of them is committed or edited by hand: they come from the content and from site.toml.

RSS

A collection writes an RSS 2.0 feed when its feed setting names a path and its type gives feed items: post and event do, member and page do not (content types). defaults.toml sets blog/feed.xml for the blog and events.xml for the events.

The feed is written in every language, under the language's prefix: blog/feed.xml and fr/blog/feed.xml, each with that language's words (languages).

Element Value
<title>the collection's feed_title
<link>the collection's page, its nav setting, as an absolute address in the language
<atom:link rel="self">the feed's own address
<description>the collection's feed_description
<language>the language of the pass, site.lang
<lastBuildDate>site.updated
one <item> per itemnewest first: the title, the address as <link> and <guid>, the date as <pubDate>, the description

Every item is in the feed, a past event as an upcoming one. A page advertises a feed in its <head> with the feed: front-matter key, the collection's name or all (writing pages).

[collections.blog]
feed = "blog/feed.xml"
feed_title = "my site blog"
feed_description = "News of my site."

iCalendar

An event collection writes an iCalendar file (RFC 5545) when its calendar setting names a path; defaults.toml sets calendar.ics for the events. Calendar apps subscribe to it. It is written once, at the root, in the default language: a calendar has no interface language.

Each event is an all-day VEVENT: from its date to its end, or the same day; a summary made of the title and calendar.name; the place as its location, lat and lon as its GEO; its address and description. The text is folded to ASCII, lines are cut at 75 octets as the standard asks, and each event's identifier is <slug>@<uid_domain>. The calendar's own name, description, product identifier and time zone come from the [calendar] table (event, configuration).

Icons

The build draws the icons from one SVG, assets/logo.svg (the file share.logo_svg names, in assets/), at every build:

File Size Used by
favicon.ico16, 32 and 48 pixels, in one filebrowsers' tabs
apple-touch-icon.png180x180a phone's home screen
icon-192.png192x192the web manifest
icon-512.png512x512the web manifest, the structured data's logo (share.logo)

logo.svg itself is served as it is, from assets/, for the browsers that take an SVG icon. The layout links the icons (layouts); the starter's writes:

<link rel="icon" href="{{ root }}favicon.ico" sizes="48x48">
<link rel="icon" href="{{ root }}logo.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="{{ root }}apple-touch-icon.png">
<link rel="manifest" href="{{ root }}site.webmanifest">

Tools and fallbacks

Drawing needs an SVG renderer. The build uses the first one it finds:

  1. rsvg-convert: it draws the text with the theme's fonts;
  2. magick, ImageMagick 7.

tilder's Docker image has rsvg-convert and woff2_decompress, so a build in Docker draws everything. With Python on its own, install one of them from your system's packages. Without either, the build still works and says so once:

warning: no rsvg-convert or magick: icons and share.png not made

The layout's links to the icons then lead nowhere, and previews point to a missing image: install a renderer before deploying. Without the logo, the file share.logo_svg names, the build says so too, and draws nothing:

warning: no logo.svg in assets/: no icons, no share.png

Every warning is listed in the command line.

The web manifest

site.webmanifest, written once at the root, tells a browser how to install the site as an app. With the defaults, laid out shorter:

{
  "name": "my site",
  "short_name": "site",
  "lang": "en",
  "start_url": "./",
  "display": "browser",
  "background_color": "#FDF6E3",
  "theme_color": "#0F6E68",
  "icons": [
    {"src": "logo.svg", "type": "image/svg+xml", "sizes": "any"},
    {"src": "icon-192.png", "type": "image/png", "sizes": "192x192"},
    {"src": "icon-512.png", "type": "image/png", "sizes": "512x512"}
  ]
}

The values are site.name, share.short_name, site.lang, share.background_color and share.theme_color, in the default language.

See also

↑ back to top