From 21bbe3e19eefc87964d78d9b946ec08504fc98b5 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:14:09 +0100 Subject: [PATCH] stork parsing improvements --- templates/toml.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/templates/toml.html b/templates/toml.html index 2cf0f9d37..1c256b94c 100644 --- a/templates/toml.html +++ b/templates/toml.html @@ -11,9 +11,22 @@ url = "{{subsection.permalink | safe}}" {% if subsection.pages -%} {%- for page in subsection.pages -%} +{%- set num = page.ancestors | length %} +{%- set sub = num - 1 %} +{%- set parent = page.ancestors | nth(n=sub - 1) %} +{%- set parentSection = get_section(path=parent) %} +{%- set directParent = get_section(path=page.ancestors | last) -%} +{%- if directParent.title == "proc" -%} + {%- set title = page.title ~ " (" ~ parentSection.title ~ " Proc)" -%} +{%- elif directParent.title == "var" -%} + {%- set title = page.title ~ " (" ~ parentSection.title ~ " Proc)" -%} +{%- else -%} + {%- set title = page.title | safe -%} +{%- endif -%} [[input.files]] path = "{{page.relative_path | safe}}" -title = "{{page.title | safe}}" +title = "{{title | safe}}" +ancestors = {{parentSection.title}} url = "{{subsection.permalink | safe}}" {% endfor -%} {%- endif -%} @@ -21,6 +34,7 @@ [input] base_directory = "content" url_prefix = "{{config.base_url | safe }}" +frontmatter_handling = "Omit" {% set index = get_section(path="_index.md") -%} {% for subsection in index.subsections -%}