Skip to content
Declan Chidlow edited this page Jul 2, 2024 · 6 revisions

The feed functionality is a subset of Adduce with a slightly different configuration to facilitate the creation of pages with repeated contents, such as blogs.

Initial Configuration

Adduce's feed functionality expects two folders, documents/ and export/. These can be generated with adduce feed establish. You then need to create a conf.toml in the directory containing these folders.

An example contents would be:

[main]

[[main.block]]
format = "html"
content_file = "head.html"

[[main.block]]
format = "document"

[[main.block]]
format = "html"
content_file = "footer.html"

This would import HTML files called head.html and footer.html and place them at the top and bottom of any exported document respectively. The block with format = "document" represents where the document's contents will be placed. If absent, the content will be placed at the bottom of the exported document.

Create Document

To create a new document, ensure you are in the folder containing your documents/ and export/ folder and conf.toml file. You can run adduce feed new <document_name>, substituting '<document_name>' for your chosen document name. This will create a new markdown document within documents/.

Edit Document

You can edit a document with adduce feed edit <document_name>. This will open the document in your system's preferred editor. On Windows this will always be Notepad. On Unix systems it will query your $EDITOR environment variable. Once finished editing, simply save the document.

Export Document

You can export your document to a HTML file by running adduce feed export <document_name>. It will be outputted to the export/ folder.

Remove Document

To remove/delete a document, you can run adduce feed remove <document_name>. This will delete both the input file from documents/ and the exported file from export/.

Search Documents

To search through your created documents, you can run adduce feed search <query>. It will provide a list of any found documents.

Atom Syndication Feed

Optionally, you can generate an Atom feed of your documents. To do this, you need to add some extra information to the top of your conf.toml file like bellow.

title = "Feed Name" # (required) Title of the feed
id = "https://example.com" # (required) Unique identifier of the feed
icon = "icon.png" # A square image that represents your feed
logo = "logo.png" # Should have a ratio of 2:1
rights = "Copyright" # Human readable information of rights held over feed
subtitle = "A description of the feed"
base = "https://example.com" # A base URL for any relative links
lang = "en" # The language the feed is written in

Once you've updated the configuration file, run adduce feed atom. It'll output the Atom feed to export/feed.xml.