Topics generates a static HTML/CSS/JS site from topics data.
Assuming bbin is installed:
bbin install io.github.bzg/topicsSuppose you have an input.json file structured like this:
[
{
"title": "Topic title",
"content": "<p>HTML</p>",
"category": "Category name"
}
]To output an index.html file:
topics input.jsonYou can add configuration in a config.edn file:
{:title "My FAQ"
:tagline "Frequently asked questions"
:footer "<a href=\"https://example.com\">My site</a>"
:source "https://example.com/data/faq.json"
:css "custom.css"}Here are the configuration keys:
:title - Website title (default: "Topics") :tagline - Website tagline (default: "Topics to explore") :footer - Footer HTML :source - URL displayed as content source :css - Custom CSS file to include
Use $ topics -c my_config.edn input.json to use another file name than
config.edn.
The index.html output can link to a custom CSS file.
By default, topics links to a custom.css file, if it exists in the
local directory, but you can use other file like this:
$ topics -C my_custom.css input.jsonTo get or provide feedback, send an email to [email protected].
topics is written as a Clojure Babashka script and we recommend
installing it with bbin. Install everything:
brew install babashka/brew/bbinFor detailed installation instructions:
If you like Clojure(script), you can support the ecosystem by making a donation to clojuriststogether.org.
The code in this repository is licensed under EPL-2.0.
