{{ section.title }}
{% if section.description %}{{ section.description }}
{% endif %}
{{ 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) %}
{% 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 %}
{{ 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 %}
Backlinks
({{ backlink_count }})
{{ backlink_items | safe }}