Skip to content

Commit

Permalink
stork parsing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hry-gh committed Aug 3, 2024
1 parent 73a1370 commit 21bbe3e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion templates/toml.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,30 @@
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 -%}
{% endmacro toml_recurse -%}
[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 -%}
Expand Down

0 comments on commit 21bbe3e

Please sign in to comment.