{% extends "base.html" %} {% block title %}{{ section.title }} · {{ config.title }}{% endblock title %} {% block description %}{{ section.description | default(value=config.description) }}{% endblock description %} {% block opengraph %} {% endblock opengraph %} {% block content %}
{% set body_html = section.content %} {% set home_sec = get_section(path="_index.md", allow_missing=true) %} {% set home_url = get_url(path="") %} {% if home_sec and home_sec.toc %} {% for h in home_sec.toc %} {% set clean_title = h.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_home_h1 = "(?i)\\[\\[Slowshell#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_home_h1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home_h1, rep=rep_home_h1) %} {% set pat_home_h2 = "(?i)\\[\\[Slowshell#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\]\\]" %} {% set rep_home_h2 = "Slowshell > " ~ h.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home_h2, rep=rep_home_h2) %} {% endfor %} {% endif %} {% set pat_home_s1 = "(?i)\\[\\[Slowshell#([a-zA-Z0-9_\\-]+)\\|([^\\]]+)\\]\\]" %} {% set rep_home_s1 = "$2" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home_s1, rep=rep_home_s1) %} {% set pat_home_s2 = "(?i)\\[\\[Slowshell#([a-zA-Z0-9_\\-]+)\\]\\]" %} {% set rep_home_s2 = "Slowshell > $1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home_s2, rep=rep_home_s2) %} {% set pat_home1 = "(?i)\\[\\[Slowshell\\|([^\\]]+)\\]\\]" %} {% set rep_home1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home1, rep=rep_home1) %} {% set pat_home2 = "(?i)\\[\\[Slowshell\\]\\]" %} {% set rep_home2 = "Slowshell" %} {% set_global body_html = body_html | regex_replace(pattern=pat_home2, rep=rep_home2) %} {% set sec_paths = config.extra.all_sections | default(value=["guides/_index.md", "references/_index.md", "modules/_index.md", "modules/panels/_index.md", "modules/panels/components/_index.md"]) %} {% for sp in sec_paths %} {% set sec = get_section(path=sp, allow_missing=true) %} {% if sec %} {% for p in sec.pages %} {% if p.toc %} {% for h in p.toc %} {% set clean_title = h.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_h1 = "(?i)\\[\\[" ~ p.title ~ "#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_h1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h1, rep=rep_h1) %} {% set pat_h2 = "(?i)\\[\\[" ~ p.title ~ "#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\]\\]" %} {% set rep_h2 = "" ~ p.title ~ " > " ~ h.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2, rep=rep_h2) %} {% if h.children %} {% for h2 in h.children %} {% set clean_title2 = h2.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_h2_1 = "(?i)\\[\\[" ~ p.title ~ "#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_h2_1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2_1, rep=rep_h2_1) %} {% set pat_h2_2 = "(?i)\\[\\[" ~ p.title ~ "#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\]\\]" %} {% set rep_h2_2 = "" ~ p.title ~ " > " ~ h2.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2_2, rep=rep_h2_2) %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% set pat_s1 = "(?i)\\[\\[" ~ p.title ~ "#([a-zA-Z0-9_\\-]+)\\|([^\\]]+)\\]\\]" %} {% set rep_s1 = "$2" %} {% set_global body_html = body_html | regex_replace(pattern=pat_s1, rep=rep_s1) %} {% set pat_s2 = "(?i)\\[\\[" ~ p.title ~ "#([a-zA-Z0-9_\\-]+)\\]\\]" %} {% set rep_s2 = "" ~ p.title ~ " > $1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_s2, rep=rep_s2) %} {% set pat1 = "(?i)\\[\\[" ~ p.title ~ "\\|([^\\]]+)\\]\\]" %} {% set rep1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat1, rep=rep1) %} {% set pat2 = "(?i)\\[\\[" ~ p.title ~ "\\]\\]" %} {% set rep2 = "" ~ p.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat2, rep=rep2) %} {% endfor %} {% if sec.title and sec.permalink %} {% if sec.toc %} {% for h in sec.toc %} {% set clean_title = h.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_h1 = "(?i)\\[\\[" ~ sec.title ~ "#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_h1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h1, rep=rep_h1) %} {% set pat_h2 = "(?i)\\[\\[" ~ sec.title ~ "#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\]\\]" %} {% set rep_h2 = "" ~ sec.title ~ " > " ~ h.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2, rep=rep_h2) %} {% if h.children %} {% for h2 in h.children %} {% set clean_title2 = h2.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_h2_1 = "(?i)\\[\\[" ~ sec.title ~ "#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_h2_1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2_1, rep=rep_h2_1) %} {% set pat_h2_2 = "(?i)\\[\\[" ~ sec.title ~ "#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\]\\]" %} {% set rep_h2_2 = "" ~ sec.title ~ " > " ~ h2.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_h2_2, rep=rep_h2_2) %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% set pat_s1 = "(?i)\\[\\[" ~ sec.title ~ "#([a-zA-Z0-9_\\-]+)\\|([^\\]]+)\\]\\]" %} {% set rep_s1 = "$2" %} {% set_global body_html = body_html | regex_replace(pattern=pat_s1, rep=rep_s1) %} {% set pat_s2 = "(?i)\\[\\[" ~ sec.title ~ "#([a-zA-Z0-9_\\-]+)\\]\\]" %} {% set rep_s2 = "" ~ sec.title ~ " > $1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_s2, rep=rep_s2) %} {% set pat1 = "(?i)\\[\\[" ~ sec.title ~ "\\|([^\\]]+)\\]\\]" %} {% set rep1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat1, rep=rep1) %} {% set pat2 = "(?i)\\[\\[" ~ sec.title ~ "\\]\\]" %} {% set rep2 = "" ~ sec.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat2, rep=rep2) %} {% endif %} {% endif %} {% endfor %} {% if section.toc %} {% for h in section.toc %} {% set clean_title = h.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_sh1 = "(?i)\\[\\[#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_sh1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh1, rep=rep_sh1) %} {% set pat_sh2 = "(?i)\\[\\[#(?:" ~ clean_title ~ "|" ~ h.id ~ ")\\]\\]" %} {% set rep_sh2 = "" ~ h.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh2, rep=rep_sh2) %} {% if h.children %} {% for h2 in h.children %} {% set clean_title2 = h2.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_sh2_1 = "(?i)\\[\\[#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_sh2_1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh2_1, rep=rep_sh2_1) %} {% set pat_sh2_2 = "(?i)\\[\\[#(?:" ~ clean_title2 ~ "|" ~ h2.id ~ ")\\]\\]" %} {% set rep_sh2_2 = "" ~ h2.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh2_2, rep=rep_sh2_2) %} {% if h2.children %} {% for h3 in h2.children %} {% set clean_title3 = h3.title | replace(from="\\", to="\\\\") | replace(from="?", to="\\?") | replace(from="(", to="\\(") | replace(from=")", to="\\)") | replace(from="[", to="\\[") | replace(from="]", to="\\]") %} {% set pat_sh3_1 = "(?i)\\[\\[#(?:" ~ clean_title3 ~ "|" ~ h3.id ~ ")\\|([^\\]]+)\\]\\]" %} {% set rep_sh3_1 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh3_1, rep=rep_sh3_1) %} {% set pat_sh3_2 = "(?i)\\[\\[#(?:" ~ clean_title3 ~ "|" ~ h3.id ~ ")\\]\\]" %} {% set rep_sh3_2 = "" ~ h3.title ~ "" %} {% set_global body_html = body_html | regex_replace(pattern=pat_sh3_2, rep=rep_sh3_2) %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% set pat_ssh1 = "(?i)\\[\\[#([a-zA-Z0-9_\\-]+)\\|([^\\]]+)\\]\\]" %} {% set rep_ssh1 = "$2" %} {% set_global body_html = body_html | regex_replace(pattern=pat_ssh1, rep=rep_ssh1) %} {% set pat_ssh2 = "(?i)\\[\\[#([a-zA-Z0-9_\\-]+)\\]\\]" %} {% set rep_ssh2 = "$1" %} {% set_global body_html = body_html | regex_replace(pattern=pat_ssh2, rep=rep_ssh2) %} {% if body_html %}
{{ body_html | safe }}
{% endif %} {% if section.subsections or section.pages %}
{% if section.subsections %} {% for sub_path in section.subsections %} {% set sub_sec = get_section(path=sub_path) %}
{{ sub_sec.title }}
{% if sub_sec.description %}
{{ sub_sec.description }}
{% endif %}
{% endfor %} {% endif %} {% for p in section.pages %}
{{ p.title }}
{% if p.description %}
{{ p.description }}
{% endif %}
{% endfor %}
{% endif %} {% set_global backlink_items = "" %} {% set_global backlink_count = 0 %} {% set target_lower = section.title | lower %} {% set tag1 = "[[" ~ target_lower ~ "]]" %} {% set tag2 = "[[" ~ target_lower ~ "|" %} {% set tag3 = "[[" ~ target_lower ~ "#" %} {% if home_sec %} {% set home_lower = home_sec.content | lower %} {% if home_lower is containing(pat=tag1) or home_lower is containing(pat=tag2) or home_lower is containing(pat=tag3) or home_sec.content is containing(pat=section.permalink) %} {% set_global backlink_count = backlink_count + 1 %} {% set card = "" ~ home_sec.title ~ "" %} {% if home_sec.description %} {% set card = card ~ "" ~ home_sec.description ~ "" %} {% endif %} {% set card = card ~ "" %} {% set_global backlink_items = backlink_items ~ card %} {% endif %} {% endif %} {% for sp in sec_paths %} {% set sec = get_section(path=sp, allow_missing=true) %} {% if sec %} {% if sec.permalink != section.permalink and sec.content %} {% set sec_lower = sec.content | lower %} {% if sec_lower is containing(pat=tag1) or sec_lower is containing(pat=tag2) or sec_lower is containing(pat=tag3) or sec.content is containing(pat=section.permalink) %} {% set_global backlink_count = backlink_count + 1 %} {% set card = "" ~ sec.title ~ "" %} {% if sec.description %} {% set card = card ~ "" ~ sec.description ~ "" %} {% endif %} {% set card = card ~ "" %} {% set_global backlink_items = backlink_items ~ card %} {% endif %} {% endif %} {% for other in sec.pages %} {% if other.permalink != section.permalink %} {% set other_lower = other.content | lower %} {% if other_lower is containing(pat=tag1) or other_lower is containing(pat=tag2) or other_lower is containing(pat=tag3) or other.content is containing(pat=section.permalink) %} {% set_global backlink_count = backlink_count + 1 %} {% set card = "" ~ other.title ~ "" %} {% if other.description %} {% set card = card ~ "" ~ other.description ~ "" %} {% endif %} {% set card = card ~ "" %} {% set_global backlink_items = backlink_items ~ card %} {% endif %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% if backlink_count > 0 %} {% endif %}
{% if section.toc and section.toc | length > 0 %} {% endif %}
{% endblock content %}