X-Git-Url: https://git.ladys.computer/Beorn/blobdiff_plain/87e79e5a942a55f386f349242b8b554d6a50db4d..c6d545001119504bae4460d27714ad1875620ed6:/README.markdown diff --git a/README.markdown b/README.markdown index 6cce62f..6a72afb 100644 --- a/README.markdown +++ b/README.markdown @@ -58,6 +58,9 @@ probably look something like this :— ``` +The value of `rdf:about` on the root element needs to be the absolute +U·R·L for your blog. + Your `entry.rdf` will look similar, but it needs a `sioc:content` property :— @@ -78,6 +81,9 @@ I love it! ``` +In this case, the `rdf:about` can be automatically filled in based on +the path to the entry from the blog root. + As you can see from the above example, 🧸📔 Bjørn supports a (nonstandard) `Markdown` value for `rdf:parseType` in addition to `Literal`. Some words of caution regarding this :— @@ -96,7 +102,69 @@ Alongside the metadata files, there are two template files, content will replace the first `` element. Metadata will be inserted into the `` for you automatically. -To modify what content is generated, simply edit `build.js` :) . +## Serving Content + +You will need a file server which supports index files with a `.xhtml` +file extension. A sample `.rsync-filter` might be as follows :— + +```rsync-filter +- /.rsync-filter +-s .git +-s .gitignore +-s /README* +-s /build.js +-s /deno.json +-s index#*.xhtml +-s #*.rdf +``` + +## Customization + +Feel free to add styles, additional content, and whatever else you like +to the template files (as well as the rest of the website). + +### Hooks + +🧸📔 Bjørn recognizes the following hooks (defined on the global +object) when it runs :— + +- **`globalThis.bjørnTransformEntryHTML(document, metadata)`:** + Receives a document and a metadata object for each generated HTML + entry. + +- **`globalThis.bjørnTransformFeedAtom(document, metadata)`:** Receives + a document and a metadata object for each generated Atom feed index. + +- **`globalThis.bjørnTransformFeedHTML(document, metadata)`:** Receives + a document and a metadata object for each generated HTML feed index. + +- **`globalThis.bjørnTransformHead(headElement, metadata, type)`:** + Receives a `` element, a metadata object, and a type value of + either `"entry"` or `"feed"`. + +- **`globalThis.bjørnTransformMetadata(metadata, type)`:** Receives a + metadata object, and a type value of either `"entry"` or `"feed"`. + Use this to provide any initial transformations to the metadata prior + to document generation. + +Naturally, when running 🧸📔 Bjørn normally from the command line, all +of these hooks are undefined. You can write your own small build script +to define them, and run that instead :— + +```js +#!/usr/bin/env -S deno run --allow-read --allow-write +// custom_build.js + +// Define your hooks first… +globalThis.bjørnTransformHead = (headElement, metadata, type) => { + Array.from(headElement.children) + .find(($) => $.localName == "title") + .textContent += " | My Cool Site"; +}; + +// Then run the script… +await import("./build.js"); +``` [CommonMark]: [Deno]: