generated from DeclanChidlow/TemplateRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Individual
Declan Chidlow edited this page Jul 1, 2024
·
2 revisions
Adduce's individual functionality is for creating standalone pages with their own structure.
To create a page, simply make a conf.toml
and fill it in accordance with the General Configuration documentation.
Individual Adduce pages are generated using the CLI. The CLI takes three arguments:
-
-c
/--config
represents the directory containing the configuration file. -
-n
/--name
represents the desired name for the output file. -
-o
/--output
represents the desired output directory.
This will spit out a compiled HTML page. To do this en masse, we recommend writing a BASH script such as this:
#!/usr/bin/env bash
pages=(
"pages/index index.html"
"pages/contact contact.html"
"pages/about about.html"
)
for page_config in "${pages[@]}"; do
page="${page_config%% *}"
name="${page_config#* }"
adduce -c "$page" -n "$name" -o output
done
A fresh directory called index/
containing three files:
conf.toml
head.html
index.md
The contents of conf.toml
should be as such:
[main]
[[main.block]]
format = "html"
content_file = "index/head.html"
[[main.block]]
format = "md"
content_file = "index/index.md"
After running adduce -c index -n index.html -o index
from the parent of the directory, a file containing both head.html
and index.md
, compiled to HTML, will be exported to index.html
within the index/
directory.
Adduce | Website | Source Code | Crate