bingus-blog/CONFIG.md
2025-01-29 17:38:10 +03:00

88 lines
3.9 KiB
Markdown

# Configuration
the configuration format, with defaults, is documented below:
```toml
[engine]
mode = "markdown" # choose which post engine to use
# options: "markdown", "blag"
# absolutely do not use "blag" unless you know exactly
# what you are getting yourself into.
[engine.markdown] # options for the `markdown` engine
root = "posts" # where posts are served from
raw_access = true # allow visitors to see the raw markdown of a post
[engine.markdown.render]
escape = false # escape HTML in the markdown soucre instead of
# clobbering it (https://docs.rs/comrak/latest/comrak/struct.RenderOptions.html#structfield.escape)
unsafe = false # allow HTML and dangerous links (https://docs.rs/comrak/latest/comrak/struct.RenderOptions.html#structfield.unsafe_)
[engine.markdown.render.syntect]
load_defaults = false # include default syntect themes
themes_dir = "themes" # directory to include themes from
theme = "Catppuccin Mocha" # theme file name (without `.tmTheme`)
[engine.blag]
root = "posts" # where posts are served from
bin = "blag" # path to the `blag` binary
raw_access = true # allow visitors to see the raw bash of a post
[style]
title = "bingus-blog" # title of the blog
# description of the blog
description = "blazingly fast blog software written in rust memory safe"
js_enable = true # enable javascript (required for sorting and dates)
date_format = "RFC3339" # format string used to format dates in the backend
# it's highly recommended to leave this as default,
# so the date can be formatted by the browser.
# format: https://docs.rs/chrono/latest/chrono/format/strftime/index.html#specifiers
default_sort = "date" # default sorting method ("date" or "name")
#default_color = "#f5c2e7" # default embed color, optional
[style.display_dates]
creation = true # display creation ("written") dates
modification = true # display modified ("last modified") dates
[rss]
enable = false # serve an rss field under /feed.xml
# this may be a bit resource intensive
link = "https://..." # public url of the blog, required if rss is enabled
[custom] # custom override directories
media = "media" # directory served under /media/
templates = "templates" # handlebars template drop-ins dir
static = "static" # custom static directory
# see CUSTOM.md for documentation
[http]
host = "::" # ip to listen on
port = 3000 # port to listen on
[cache]
enable = true # save metadata and rendered posts into RAM
# highly recommended, only turn off if absolutely necessary
#ttl = 5 # how long should and item persist in cache,
# in milliseconds
# uncomment to enable
cleanup = true # clean cache, highly recommended
#cleanup_interval = 86400000 # clean the cache regularly instead of
# just at startup, value in milliseconds
# uncomment to enable
persistence = true # save the cache to on shutdown and load on startup
file = "cache" # file to save the cache to
compress = true # compress the cache file
compression_level = 3 # zstd compression level, 3 is recommended
```
configuration is done in [TOML](https://toml.io/)
if an option marked "optional" is not set, it will not be initialized with
a default value
you don't have to copy the whole thing from here,
it's generated by the program if it doesn't exist
## Specifying the configuration file
the configuration file is loaded from `config.toml` by default, but the path
can be overriden by setting the environment variable `BINGUS_BLOG_CONFIG`,
which will make bingus-blog try to read that file or fail and exit.