-
Notifications
You must be signed in to change notification settings - Fork 88
/
soupault.toml
146 lines (127 loc) · 4.58 KB
/
soupault.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Configuration file for the soupault website generator/HTML processor
# (see https://soupault.app/reference-manual/ for details).
[settings]
doctype = "<!DOCTYPE html>"
generator_mode = true
# Soupault templates are really just empty HTML pages
# so don't be surprised that it has no {{template tags}} or anything.
# Soupault inserts content into the empty page skeleton
# by manipulating its element tree instead.
default_template_file = "templates/main.html"
# Content from site/index.md is inserted in the <main>
# or templates/main.html
default_content_selector = "main"
verbose = true
debug = true
[preprocessors]
# Convert *.md Markdown pages to HTML using cmark (with https://github.com/commonmark/cmark)
# before further processing.
#
# You need cmark installed on your system for this to work.
md = "cmark --unsafe --smart"
# Creates a table of contents from the page headings
# and inserts it in the element with id="sidebar" as per the selector and action options.
[widgets.toc]
widget = "toc"
selector = "#sidebar"
action = "prepend_child"
min_level = 2
max_level = 3
toc_list_class = "toc"
toc_class_levels = false
# Insert a link to the current section next to each heading for easy copying.
# When ids are persistent, deep linking is not bad, it's great.
heading_links = true
heading_link_class = "here"
heading_link_text = "# "
# Use slugified <h*> tag content for the id
# is a heading doesn't have an id attribute.
#
# If a heading does have an id, like <h2 id="ip-route">
# that id is preserved and used in the ToC link.
use_heading_slug = true
# Wrap every sub-list in a <li>, as the HTML standard demands.
valid_html = true
# Sets the page <title> to the content of its first <h1>
# to avoid having to write the title by hand
[widgets.set-title]
widget = "title"
selector = "h1"
force = true
# This widget comes from plugins/collapsible-list.lua
#
# It converts nested <ul>/<ol> elements to a tree with foldable nodes
# using HTML5 <details>/<summary> elements.
[widgets.toc-collapse]
after = "toc"
widget = "collapsible-list"
collapsible_class = "collapsible"
# This widget comes from plugins/inline-assets.lua
#
# It inlines all external assets, e.g.,
# converts <link rel="stylesheet"> to inline <style>
# and inlines images as Base64.
#
# This allows the generated page to be truly standalone
# without sacrificing the convenience of external files for development.
[widgets.inline-assets]
widget = "inline-assets"
delete_files = true
inline_images = true
# This widget comes from plugins/git-timestamp.lua
#
# It retrieves the date when site/index.md was last modified
# from the git commit history and inserts it in the page.
[widgets.insert-timestamp-from-git]
widget = "git-timestamp"
timestamp_container_selector = "#last-modified"
timestamp_format = '<time id="revision">%s</time>'
git_date_format = "short"
# Having chunks of the page wrapped in <div> or some other block elements
# make styling a lot simpler.
# However, writing those wrapper elements by hand is annoying.
# That's where the plugin from plugins/wrap-sections.lua comes into play.
#
# Here it takes this:
#
# <h3>First heading</h3>
# <p>First paragraph</p>
# <h3>Second heading</h3>
# <p>First paragraph</p>
#
# and converts it to this:
#
# <div class="subsection">
# <h3>First heading</h3>
# <p>First paragraph</p>
# </div>
# <div class="subsection">
# <h3>Second heading</h3>
# ...
[widgets.wrap-subsections]
widget = "wrap-sections"
selector = "main"
wrapper_element = "div"
level = 3
class = "subsection"
# Same, but for the <h2> level
# One use for it is the different background color for even subsections of a section.
# Applying :nth-child(even) to subsections without wrapping them in section may create an awkward look
# when a previous section has an odd number of subsections: in that case it's the _first_ child
# that ends up colored differently.
# The only way to prevent that is to make all subsection elements children of a single parent.
[widgets.wrap-sections]
widget = "wrap-sections"
selector = "main"
wrapper_element = "div"
level = 2
class = "section"
# goatcounter.com provides a privacy-respecting stats collection service
[widgets.add-goatcounter-script]
# We probably don't want to inline this script since it's:
# a) not required for the page functionality b) may be updated upstream
after = "inline-assets"
widget = 'insert_html'
html = '<script data-goatcounter="https://dmbaturin.goatcounter.com/count" async="async" src="//gc.zgo.at/count.js"></script>'
selector = 'body'
action = 'append_child'