~hristoast/hristoast

hristoast/soupault.conf -rw-r--r-- 6.1 KiB
27ec638fHristos N. Triantafillou Typo a month ago
                                                                                
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# -*- toml -*-
# hristoast - soupault.conf
# Copyright (C) 2019,2020  Hristos N. Triantafillou
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

[custom_options]
  site_url = "https://hristos.co"

[settings]
  # debug = true
  # verbose = true
  clean_urls = true
  generator_mode = true
  strict = true
  site_dir = "site"
  build_dir = "build"
  page_file_extensions = ["html"]
  ignore_extensions = ["draft"]
  complete_page_selector = "html"
  default_template_file = "templates/main.html"
  default_content_selector = "div#content"
  doctype = "<!DOCTYPE html>"

#
# The "full" index, used by the sitemap.
#
[index]
  index = true
  dump_json = "index.json"
  path_regex = '^site\/((contact|cv-resume|init\.el|privacy|projects)\.html$|(audio\/covers|blog)\/(.*)\.html$)'
  sort_by = "date"
  date_formats = ["%F"]
  extract_after_widgets = ['last-modified']

#
# What fields do I care about, and where do they come from?
#
[index.fields]
  date = { selector = [ "#post-date", "time" ] }
  excerpt = { selector = [ "#post-excerpt", "p" ] }
  git_timestamp = { selector = [ "#git-timestamp" ] }
  title = { selector = [ "#title", "h1" ] }

#
# The partial index found on /
#
[index.views.index]
  path_regex = '^site\/(audio\/covers|blog)\/(.*)\.html$'
  index_processor = "scripts/index.py"
  index_selector = "div#blog-index"
  section = "blog"

#
# The full index found on /blog/
#
[index.views.blog]
  path_regex = '^site\/(audio\/covers|blog)\/(.*)\.html$'
  index_selector = "div#blog-all"
  index_item_template = """
<div class="entry">
  <h4>
    <a href="{{url}}">
      {{title}}
    </a>
  </h4>
  <p>
    Posted: <time>{{date}}</time>
  </p>
  <p>
    {{excerpt}}
  </p>
  <a href="{{url}}">
    Read more...
  </a>
</div>
"""

#
# Generate an Atom feed from an index that's been rendered to a page.
#
[widgets.atom]
  widget = "atom"
  profile = "live"
  page = "blog/index.html"
  use_section = "blog"
  delete_elements = [".footnote", "a"]
  feed_file = "atom.xml"
  feed_author = "Hristos"
  feed_author_email = "me@hristos.co"
  feed_title = "Hristos N. Triantafillou"
  feed_subtitle = "The personal website of Hristos N. Triantafillou"
  feed_logo = "https://hristos.co/img/slime.png"

#
# Generate a sitemap from the main index.
#
[widgets.sitemap]
  widget = "sitemap"
  profile = "live"
  sitemap_file = "sitemap.xml"

#
# Footnote links are not useful in the excerpts used in indexes, remove them.
#
[widgets.remove-footnotes-from-excerpts]
  path_regex = 'site\/(.*)index.html$'
  widget = "delete_element"
  selector = ".footnote"

#
# "Highlight" a nav link if applicable.
#
[widgets.highlight-active-link]
  widget = "section-link-highlight"
  selector = "nav"
  active_link_class = "bold"

#
# Provide a link to the source code of a given page.
#
[widgets.source-link]
  widget = "source-link"
  selector = "div#source-link"
  link_text = "Source link for this page"
  repo_base = "https://git.sr.ht/~hristoast/hristoast/tree/master/"

#
# https://soupault.neocities.org/reference-manual/#footnotes-widget
#
[widgets.footnotes]
  widget = "footnotes"
  selector = "#footnotes"
  footnote_selector = ".footnote"
  footnote_template = "<p></p>"
  ref_template = "<sup></sup>"
  footnote_link_class = "footnote"
  back_links = true
  link_id_prepend = ""
  back_link_id_append = ""

#
# Show the last time a git commit was made to a page.
#
[widgets.last-modified]
  widget = "exec"
  selector = "#git-timestamp"
  command = "git log -n 1 --pretty=format:%ad --date=format:%Y-%m-%d -- $PAGE_FILE"

#
# https://soupault.neocities.org/reference-manual/#title-widget
#
[widgets.page-title]
  widget = "title"
  selector = "h1#title"
  default = "Hristos N. Triantafillou"
  append = " | Hristos N. Triantafillou"

#
# https://soupault.neocities.org/reference-manual/#toc-widget
#
[widgets.table-of-contents]
  widget = "toc"
  selector = "#toc"
  heading_links = true
  heading_link_text = "→ "
  heading_link_class = "here"
  min_level = 2
  numbered_list = false
  toc_list_class = "toc"
  toc_class_levels = false
  use_heading_slug = true
  valid_html = true

#
# Run `highlight` when a "language-*" CSS class is present.
#
[widgets.highlight-code]
  widget = "preprocess_element"
  selector = '*[class^="language-"]'
  command = 'highlight -O html -f --syntax=$(echo $ATTR_CLASS | sed -e "s/language-//")'

#
# Conditionally load CSS or JS based on the presence of a given selector.
#
[widgets.highlight-code-css]
  widget = "insert-if"
  html = "<link rel='stylesheet' type='text/css' href='/css/highlight.css' />"
  selector = "head"
  check_selector = "code"

[widgets.highlight-code-darkmode-css]
  widget = "insert-if"
  html = "<link rel='stylesheet' type='text/css' media='(prefers-color-scheme: dark)' href='/css/highlight-dark.css'/>"
  selector = "head"
  check_selector = "code"

[widgets.asciinema-player-css]
  widget = "insert-if"
  html = "<link rel='stylesheet' type='text/css' href='/asciinema/asciinema-player.css' />"
  selector = "head"
  check_selector = "asciinema-player"

[widgets.asciinema-player-js]
  widget = "insert-if"
  html = "<script src='/asciinema/asciinema-player.js' type='text/javascript'></script>"
  selector = "body"
  check_selector = "asciinema-player"

[widgets.init-el-js]
  widget = "insert-if"
  html = "<script src='/js/init.el.js' type='text/javascript'></script>"
  selector = "body"
  check_selector = "pre#init-el"

[widgets.tracking-js]
  profile = "live"
  after = "source-link"
  widget = "insert_html"
  html = '<script data-goatcounter="https://stats.hristos.co/count" async src="//stats.hristos.co/count.js"></script>'
  selector = "body"
  parse = true