const DC11 = "http://purl.org/dc/elements/1.1/";
const FOAF = "http://xmlns.com/foaf/0.1/";
const RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+const RDFS = "http://www.w3.org/2000/01/rdf-schema#";
const SIOC = "http://rdfs.org/sioc/ns#";
const XML = "http://www.w3.org/XML/1998/namespace";
const XHTML = "http://www.w3.org/1999/xhtml";
},
rights: { namespace: DC11, localName: "rights", type: "text" },
// source is not supported at this time
- // subtitle is not supported at this time
+ subtitle: { namespace: RDFS, localName: "label", type: "text" },
summary: { namespace: DC11, localName: "abstract", type: "text" },
title: { namespace: DC11, localName: "title", type: "text" },
// updated is provided by the build script
const {
title,
author,
+ subtitle,
summary,
} = metadata;
titleElement.textContent = Object(title) instanceof String
.href("../../feed.atom")``,
);
} else {
+ // The provided document is not an entry document.
+ if (subtitle) {
+ // The entry has a subtitle.
+ head.appendChild(
+ LMN.meta({
+ name: "description",
+ content: Object(subtitle) instanceof String
+ ? summary
+ : Array.from(subtitle).map(($) => $.textContent).join(""),
+ })``,
+ );
+ } else {
+ /* do nothing */
+ }
head.appendChild(
LMN.link
.rel("alternate")
const {
id,
title,
+ subtitle,
rights,
updated,
} = feedMetadata;
"bjørn-content",
).item(0);
if (contentPlaceholder != null) {
+ // There is a content placeholder.
const { parentNode: contentParent } = contentPlaceholder;
const contentElement = contentParent.insertBefore(
LMN.nav.about(`${id}`)`${"\n"}`,
title,
);
addContent(contentHeader, "\n");
+ if (subtitle) {
+ // The feed has a subtitle.
+ addContent(
+ contentHeader.appendChild(LMN.p.property(`${RDFS}label`)``),
+ subtitle,
+ );
+ addContent(contentHeader, "\n");
+ } else {
+ // The feed has no subtitle.
+ /* do nothing */
+ }
addContent(contentElement, "\n");
const entriesElement = contentElement.appendChild(
LMN.ul.rel(`${AWOL}entry`)`${"\n"}`,
LMN.footer`${"\n\t"}`,
);
if (rights) {
+ // The feed has a rights statement.
addContent(
contentFooter.appendChild(
LMN.div.property(`${DC11}rights`)``,
rights,
);
addContent(contentFooter, "\n\t");
+ } else {
+ // The feed has no rights statement.
+ /* do nothing */
}
contentFooter.appendChild(
LMN.p.id("entry.updated")`Last updated: ${LMN.time.property(