antenna themes
A directory with page elements in Markdown or YAML
A directory with files that can be used to generate an antenna page generator description. The antenna uses a page generator description YAML file to render HTML pages. The YAML structure is organized around those elements that are in the HTML head element as well as the body elements of HTML pages.
A theme is held in a directory. The directory name is used as the theme’s name. Inside the directory are zero or more files where their names map the YAML attribute names in a page generator YAML file. Here is an example of a theme called “theme” that can be applied to generate a generator YAML file.
theme\header.md
theme\nav.md
theme\top_content.md
theme\bottom_content.md
theme\footer.md
theme\head.yaml
theme\style.css
The following Markdown documents are used to express their related attributes in the page generator YAML files. Markdown is used to express the HTML values that will be used in the page generator file for these attributes. The elements describe form the innerHTML of the body element in an HTML document. They are rendered in the order presented if they are present.
The head element’s content may also be included in a theme. It is expressed as a YAML file called “head.yaml”. YAML is used because there is not a direct relationship between the element attributes and how they could be expressed using Markdown. Most of the time the head.yaml isn’t necessary in the theme because antenna generates most of the head elements’ content automatically. There are times when my wish to enhance the generated content (e.g. include link elements pointing to files or include script elements JavaScript). The head element’s innerHTML is populated in the order of meta elements, link elements and script elements if they are defined in the YAML as the attributes meta, link and script. Each of these top level YAML elements are list and the individual items in the list express the attribute names and values that form that element.
Here is an example “head.yaml”
title: My theme based title
meta:
- charset: utf-8
- name: language
content: en-US
link:
- rel: alternate
type: application/rss+xml
href: archive.xml
- rel: stylesheet
href: /css/site.css
script:
- type: module
src: modules/myscript.js
style: |+
/* This CSS will turn headings vertical */
h1 {
writing-mode: vertical-rl;
transform: rotate(180deg);
text-orientation: mixed;
}NOTE: In this example the last style element will override the H1 definitions previously included in the CSS files using the link attributes.