From a0b52e7ce0e6bb5befeed92a93468a71b9a7b14c Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Mon, 18 Nov 2024 04:50:14 +0100 Subject: [PATCH] improve navigation of top-level sections; closes #791 --- content/about/_index.md | 2 +- content/join/_index.md | 2 +- content/workshops/_index.md | 2 +- templates/about.html | 10 ++++++++++ templates/join.html | 10 ++++++++++ templates/macros.html | 22 ++++++++++++++++++++++ templates/section-tree.html | 28 ---------------------------- templates/workshops.html | 10 ++++++++++ 8 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 templates/about.html create mode 100644 templates/join.html delete mode 100644 templates/section-tree.html create mode 100644 templates/workshops.html diff --git a/content/about/_index.md b/content/about/_index.md index 51c26e6d..ef572d27 100644 --- a/content/about/_index.md +++ b/content/about/_index.md @@ -1,4 +1,4 @@ +++ title = "About the project" -template = "section-tree.html" +template = "about.html" +++ diff --git a/content/join/_index.md b/content/join/_index.md index cfea2077..3bba9093 100644 --- a/content/join/_index.md +++ b/content/join/_index.md @@ -1,4 +1,4 @@ +++ title = "Why and how to join" -template = "section-tree.html" +template = "join.html" +++ diff --git a/content/workshops/_index.md b/content/workshops/_index.md index 53e2538e..6bcb3aea 100644 --- a/content/workshops/_index.md +++ b/content/workshops/_index.md @@ -1,4 +1,4 @@ +++ title = "Workshops and events" -template = "section-tree.html" +template = "workshops.html" +++ diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 00000000..c0d8e4cd --- /dev/null +++ b/templates/about.html @@ -0,0 +1,10 @@ +{% import "macros.html" as macros %} + +{% extends "base.html" %} + +{% block content %} +

{{ section.title }}

+ + {% set data = load_data(path="content/navigation.yml") %} + {{ macros::section_tree(navigation=data.navigation, section="About") }} +{% endblock content %} diff --git a/templates/join.html b/templates/join.html new file mode 100644 index 00000000..9e66175e --- /dev/null +++ b/templates/join.html @@ -0,0 +1,10 @@ +{% import "macros.html" as macros %} + +{% extends "base.html" %} + +{% block content %} +

{{ section.title }}

+ + {% set data = load_data(path="content/navigation.yml") %} + {{ macros::section_tree(navigation=data.navigation, section="Join") }} +{% endblock content %} diff --git a/templates/macros.html b/templates/macros.html index da050de5..4414a0ec 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -237,3 +237,25 @@ {% endif %} {% endmacro toc %} + +{% macro section_tree(navigation, section) %} +
+ +
+{% endmacro section_tree %} diff --git a/templates/section-tree.html b/templates/section-tree.html deleted file mode 100644 index 581a521f..00000000 --- a/templates/section-tree.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends "base.html" %} - -{% block content %} - {% if section.title %} -

{{ section.title }}

- {% endif %} - -
- -
- - {% if section.content %} - {{ section.content | safe }} - {% endif %} -{% endblock content %} diff --git a/templates/workshops.html b/templates/workshops.html new file mode 100644 index 00000000..3c6bddec --- /dev/null +++ b/templates/workshops.html @@ -0,0 +1,10 @@ +{% import "macros.html" as macros %} + +{% extends "base.html" %} + +{% block content %} +

{{ section.title }}

+ + {% set data = load_data(path="content/navigation.yml") %} + {{ macros::section_tree(navigation=data.navigation, section="Workshops and events") }} +{% endblock content %}