-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoupault.conf
204 lines (169 loc) · 6.56 KB
/
soupault.conf
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# To learn about configuring soupault, visit https://www.soupault.app/reference-manual
[settings]
# 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 = "site"
# Where the output goes
build_dir = "_site"
# 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"]
# Files with these extensions are ignored.
ignore_extensions = ["draft"]
# 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/default.html"
# Page content is inserted into a certain element of the page template. This option is a CSS selector
# used for locating that element.
# By default the content is inserted into the <body>
default_content_selector = "div.page-content"
# 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>"
# Enables or disables clean URLs.
# When false: site/about.html -> build/about.html
# When true: site/about.html -> build/about/index.html
clean_urls = true
# It is possible to store pages in any format if you have a program
# that converts it to HTML and writes it to standard output.
# Example:
[preprocessors]
md = "cmark-gfm -e table --unsafe --smart"
adoc = "asciidoctor -o -"
[templates.blog-post]
file = "templates/post.html"
content_selector = ".entry-content"
content_action = "append_child"
section = "blog/"
include_subsections = true
exclude_page = "blog/index.html"
[index]
index = true
sort_by = "date"
sort_descending = true
sort_type = "calendar"
# "%F" is YYYY-MM-DD
date_formats = ["%F"]
# strict_sort = true
[index.fields.title]
# NOTE manually keep in sync with post-template.lua
selector = [".entry-content h1#post-title", ".entry-content h1"]
[index.fields.date]
# NOTE manually keep in sync with post-template.lua
selector = [".entry-content date#post-date", ".entry-content date"]
[index.fields.tags]
# NOTE manually keep in sync with post-template.lua
selector = [".entry-content tags#post-tags", ".entry-content tags"]
[index.views.blog]
# for now this only works with #blog-index on site/blog/index.html page
section = ["blog"]
include_subsections = true
index_selector = "#blog-index"
index_item_template = """
<li class="post">
<div class="permalink">
<a href="{{url}}">
{{title}}
</a>
</div>
<div class="meta">
<span class="meta-item date">
{{date}}
</span>
<span class="meta-item tags">
{{tags}}
</span>
</div>
</li>
"""
# Pages can be further processed with "widgets"
# Takes the content of the first <h1> and inserts it into the <title>
[widgets.page-title]
widget = "title"
selector = [".page-content h1#post-title", ".page-content h1", "#page-title"]
default = "Ryan Artecona"
append = " — Ryan Artecona"
# Insert a <title> in a page if it doesn't have one already.
# By default soupault assumes if it's missing, you don't want it.
force = false
# custom widget in plugins/redirect.lua
[widgets.redirect]
widget = "redirect"
template = "templates/redirect.html"
# https://soupault.app/plugins/#file-inclusion
[widgets.process-include-tags]
widget = "inline-include"
# https://soupault.app/plugins/#active-link-highlight
[widgets.highlight-active-link]
widget = "section-link-highlight"
menu_selector = "ul.nav-items"
item_selector = "li.nav-item"
active_item_class = "current"
[widgets.relativize]
after = "highlight-active-link"
widget = "relative_links"
[widgets.post-template]
widget = "post-template"
# NOTE page filters should match blog post template above
section = "blog"
exclude_page = "blog/index.html"
include_subsections = true
# Runs the content of <* class="language-*"> elements through a syntax highlighter
# from https://github.com/dmbaturin/baturin.org/blob/master/soupault.conf
[widgets.highlight]
widget = "preprocess_element"
selector = '*[class^="language-"]'
# command = 'highlight -O html -f --syntax=$(echo $ATTR_CLASS | sed -e "s/language-//")'
# command = 'pygmentize -f html -l $(echo $ATTR_CLASS | sed -e "s/language-//")'
command = 'chroma -f html --html-only -l $(echo $ATTR_CLASS | sed -e "s/language-//")'
action = "replace_content"
[widgets.pygmentize-fixup]
after = "highlight"
# widget = "pygmentize-fixup"
widget = "chroma-fixup"
[widgets.toc-insert]
widget = "toc"
selector = "div#toc"
use_heading_slug = true
min_level = 2
max_level = 6
heading_links = true
heading_link_class = "heading-anchor"
# toc widget inserts both table of contents and heading anchors, but I only want
# the toc on some posts. this fixup script removes the toc on posts I haven't
# enabled it on, leaving heading anchors in place.
[widgets.toc-fixup]
after = "toc-insert"
widget = "toc-fixup"
section = "blog"
include_subsections = true
toc_container_selector = "div#toc"
toc_trigger_selector = "toc"