# -*- 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']
[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>
"""
[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"
[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"
[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