-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoupault.toml
More file actions
189 lines (152 loc) · 6.39 KB
/
soupault.toml
File metadata and controls
189 lines (152 loc) · 6.39 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# To learn about configuring soupault, visit https://www.soupault.app/reference-manual
[settings]
# Soupault version that the config was written/generated for
# Trying to process this config with an older version will result in an error message
soupault_version = "4.10.0"
# Stop on page processing errors?
strict = true
# Display progress?
verbose = true
# Display detailed debug output?
debug = false
# Where input files (pages and assets) are stored.
site_dir = "."
# Where the output goes
build_dir = "build"
ignore_directories = [
".git",
".soupault-cache",
"templates", "plugins", "scripts", "node_modules",
# Prevent Soupault from re-processing its outputs
"build",
]
ignore_path_regexes = [
'/package\.json$', '/yarn\.lock$',
]
# Page files with these extensions are ignored.
ignore_extensions = ["swp", "nix", "toml", "gitignore", "piskel", "envrc"]
# Files inside the site/ directory can be treated as pages or static assets,
# depending on the extension.
#
# Files with extensions from this list are considered pages and processed.
# All other files are copied to build/ unchanged.
#
# Note that for formats other than HTML, you need to specify an external program
# for converting them to HTML (see below).
page_file_extensions = ["htm", "html", "md", "rst", "adoc"]
clean_urls = false
# If you set clean_urls=false,
# file names with ".html" and ".htm" extensions are left unchanged.
keep_extensions = ["html", "htm"]
# All other extensions (".md", ".rst"...) are replaced, by default with ".html"
default_extension = "html"
# Soupault can work as a website generator or an HTML processor.
#
# In the "website generator" mode, it considers files in site/ page bodies
# and inserts them into the empty page template stored in templates/main.html
#
# Setting this option to false switches it to the "HTML processor" mode
# when it considers every file in site/ a complete page and only runs it through widgets/plugins.
generator_mode = true
# Files that contain an <html> element are considered complete pages rather than page bodies,
# even in the "website generator" mode.
# This allows you to use a unique layout for some pages and still have them processed by widgets.
complete_page_selector = "html"
# Website generator mode requires a page template (an empty page to insert a page body into).
# If you use "generator_mode = false", this file is not required.
default_template_file = "templates/main.html"
# Page content is inserted into a certain element of the page template.
# This option is a CSS selector that is used for locating that element.
# By default the content is inserted into the <body>
default_content_selector = "article"
# You can choose where exactly to insert the content in its parent element.
# The default is append_child, but there are more, including prepend_child and replace_content
default_content_action = "append_child"
# If a page already has a document type declaration, keep the declaration
keep_doctype = true
# If a page does not have a document type declaration, force it to HTML5
# With keep_doctype=false, soupault will replace existing declarations with it too
doctype = "<!DOCTYPE html>"
# Insert whitespace into HTML for better readability
# When set to false, the original whitespace (if any) will be preserved as is
pretty_print_html = false
# Plugins can be either automatically discovered or loaded explicitly.
# By default discovery is enabled and the place where soupault is looking is the plugins/ subdirectory
# in your project.
# E.g., a file at plugins/my-plugin.lua will be registered as a widget named "my-plugin".
plugin_discovery = true
plugin_dirs = ["plugins"]
# Soupault can cache outputs of external programs
# (page preprocessors and preprocess_element widget commands).
# It's disabled by default but you can enable it and configure the cache directory name/path
caching = true
cache_dir = ".soupault-cache"
# Soupault supports a variety of page source character encodings,
# the default encoding is UTF-8
page_character_encoding = "utf-8"
[asset_processors]
build-gitignore = "cp {{source_file_path}} {{target_dir}}/.gitignore"
[preprocessors]
# The --katex flag here doesn't cause pandoc to actually bring in any library,
# since we aren't compiling for standalone; instead, it just leaves it as-is
# inside <span class="math"> tags that can be preprocessed by Soupault widgets.
md = """\
pandoc \
--from markdown+tex_math_dollars-auto_identifiers+lists_without_preceding_blankline-citations \
--katex \
--wrap=preserve \
--to html\
"""
# Pages can be further processed with "widgets"
# Takes the content of the first <h1> and inserts it into the <title>
[widgets.page-title]
exclude_section = "games"
include_subsections = true
widget = "title"
selector = "h1"
append = " — Christine's World Wide Web Site"
force = false
[widgets.create-footer]
widget = "include"
file = "templates/footer.html"
selector = "footer"
[widgets.relativize]
# Rewrite absolute paths to relative paths
widget = "relative_links"
after = "create-footer"
[widgets.run-scripts]
widget = "preprocess_element"
selector = [ "script[buildtime]" ]
command = "node"
action = "replace_element"
[widgets.add-katex-css]
widget = "insert-if"
html = """\
<link rel="stylesheet" \
href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" \
integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" \
crossorigin="anonymous">\
"""
selector = "head"
check_selector = "span.math"
[widgets.inline-math]
widget = "preprocess_element"
selector = [ "p > math", "li > math", "figcaption > math", "span.math.inline" ]
command = "node scripts/katex.js"
action = "replace_element"
after = "add-katex-css"
[widgets.display-math]
widget = "preprocess_element"
selector = [ "article > math", "span.math.display" ]
command = "KATEX_DISPLAY_MODE=1 node scripts/katex.js"
action = "replace_element"
after = "add-katex-css"
# Inserts a generator meta tag in the page <head>
# Just for demonstration, feel free to remove
[widgets.generator-meta]
widget = "insert_html"
html = '<meta name="generator" content="soupault">'
selector = "head"
after = "add-katex-css"
[widgets.footnotes]
widget = "custom-footnotes"