diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-09-13 15:01:06 -0600 |
| commit | f4fcda54638685899c730b3fa90a87d80d6dbef5 (patch) | |
| tree | 0737e627cce304c3a9c4e757bc5f6571a7456091 /sysret.org/themes/tabi-lean/templates/section.html | |
| parent | d8b9cf1f61cc07d625f1c37ccc28adfd58918416 (diff) | |
| parent | 2c13119932765c6d788f08fb53abc244407c0d80 (diff) | |
Merge commit '6a7d3111b31e73fc66af5360149d41f690fbcaa4'
Diffstat (limited to 'sysret.org/themes/tabi-lean/templates/section.html')
| -rw-r--r-- | sysret.org/themes/tabi-lean/templates/section.html | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sysret.org/themes/tabi-lean/templates/section.html b/sysret.org/themes/tabi-lean/templates/section.html new file mode 100644 index 0000000..3f2af39 --- /dev/null +++ b/sysret.org/themes/tabi-lean/templates/section.html @@ -0,0 +1,57 @@ +{% extends "base.html" %} + +{% block main_content %} + +{# We'll only pin posts in the root section. #} +{# Right now both the main page and blog/ use the same `section.html` template. #} +{# To avoid using different templates, we do this. #} +{%- if lang == config.default_language -%} + {%- set expected_root = "/" -%} +{%- else -%} + {%- set expected_root = "/" ~ lang ~ "/" -%} +{%- endif -%} +{%- set is_root_section = current_path == expected_root -%} + +{%- set show_projects_first = section.extra.show_projects_first | default(value=false) -%} +{%- if show_projects_first -%} + {%- set first_section = "projects" -%} +{%- else -%} + {%- set first_section = "posts" -%} +{%- endif -%} + +{%- if section.extra.section_path or paginator and projects_path -%} + {%- set more_than_one_section_shown = true -%} +{%- endif -%} + +<main {% if more_than_one_section_shown %}class="{{ first_section }}-first"{% endif %}> +{%- if config.extra.hcard %} + {%- include "partials/hcard.html" -%} +{% endif -%} +{%- if section.extra.header %} + {%- include "partials/home_banner.html" -%} +{%- elif section.content -%} +<section> + {{ section.content | safe }} +</section> +{% endif -%} + +{% if section.extra.section_path -%} + {% set extra_section = get_section(path=section.extra.section_path) %} +{% endif -%} + +{% if section.extra.section_path -%} + {% set path = section.extra.section_path | replace(from="/_index.md", to = "") %} +{% else -%} + {% set path = section.path %} +{% endif -%} + +{%- if show_projects_first -%} + {%- include "partials/main_page_projects_list.html" -%} + {%- include "partials/main_page_posts_list.html" -%} +{%- else -%} + {%- include "partials/main_page_posts_list.html" -%} + {%- include "partials/main_page_projects_list.html" -%} +{%- endif -%} +</main> + +{% endblock main_content %} |
