From a30f5e8b8006b516adc2cb25ebbc4b82b9f8351e Mon Sep 17 00:00:00 2001 From: DKFN Date: Sat, 5 Oct 2019 18:04:28 +0200 Subject: [PATCH 1/4] Adds simple section page --- templates/section.html | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 templates/section.html diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..4a4377a --- /dev/null +++ b/templates/section.html @@ -0,0 +1,31 @@ +{% extends "index.html" %} +{% import "post_macros.html" as post_macros %} +{% import "index_macros.html" as index_macros %} + +{% block content %} + +{% block header %} +{{ super() }} +{% endblock header %} + +
+ {{ index_macros::hero(title=section.extra.zulma_title, primary=true) }} +
+
+
+ {% if paginator %} + {{ index_macros::list_articles(pages=paginator.pages) }} + {% else %} + {{ index_macros::list_articles(pages=section.pages) }} + {% endif %} + + + {% if paginator %} + {{ index_macros::paginate(paginator=paginator) }} + {% endif %} + +
+
+
+
+{% endblock content %} \ No newline at end of file From 466146a601b240ae3e249a2eecd3e7ab58e81721 Mon Sep 17 00:00:00 2001 From: DKFN Date: Sat, 5 Oct 2019 18:17:48 +0200 Subject: [PATCH 2/4] Fixes indentation and comments --- templates/section.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/templates/section.html b/templates/section.html index 4a4377a..d160224 100644 --- a/templates/section.html +++ b/templates/section.html @@ -13,17 +13,18 @@
+ {% if paginator %} - {{ index_macros::list_articles(pages=paginator.pages) }} - {% else %} - {{ index_macros::list_articles(pages=section.pages) }} - {% endif %} - - - {% if paginator %} - {{ index_macros::paginate(paginator=paginator) }} - {% endif %} - + {{ index_macros::list_articles(pages=paginator.pages) }} + {% else %} + {{ index_macros::list_articles(pages=section.pages) }} + {% endif %} + + + {% if paginator %} + {{ index_macros::paginate(paginator=paginator) }} + {% endif %} +
From f59f6bf8df96f1f5a634faaa9a98ff2e447000f2 Mon Sep 17 00:00:00 2001 From: DKFN Date: Sat, 5 Oct 2019 22:38:47 +0200 Subject: [PATCH 3/4] zulma title not mandatory in section --- templates/section.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/section.html b/templates/section.html index d160224..8e5cdc4 100644 --- a/templates/section.html +++ b/templates/section.html @@ -9,7 +9,11 @@ {% endblock header %}
- {{ index_macros::hero(title=section.extra.zulma_title, primary=true) }} + + {% if section.section.extra.zulma_title %} + {{ index_macros::hero(title=section.extra.zulma_title, primary=true) }} + {% endif %} +
From 6244379cb7947388ba6353c19d628b8025cdbdfb Mon Sep 17 00:00:00 2001 From: DKFN Date: Sat, 5 Oct 2019 22:43:16 +0200 Subject: [PATCH 4/4] Adds content to test and fix typo --- content/test-section/_index.md | 5 +++++ content/test-section/sub-section/_index.md | 6 ++++++ templates/section.html | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 content/test-section/_index.md create mode 100644 content/test-section/sub-section/_index.md diff --git a/content/test-section/_index.md b/content/test-section/_index.md new file mode 100644 index 0000000..9682cab --- /dev/null +++ b/content/test-section/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Test section" + +description = "Test" ++++ \ No newline at end of file diff --git a/content/test-section/sub-section/_index.md b/content/test-section/sub-section/_index.md new file mode 100644 index 0000000..a441445 --- /dev/null +++ b/content/test-section/sub-section/_index.md @@ -0,0 +1,6 @@ ++++ +title = "Sub Section" + +[extra] +zulma_title = "Hero title" ++++ \ No newline at end of file diff --git a/templates/section.html b/templates/section.html index 8e5cdc4..31446ab 100644 --- a/templates/section.html +++ b/templates/section.html @@ -10,7 +10,7 @@
- {% if section.section.extra.zulma_title %} + {% if section.extra.zulma_title %} {{ index_macros::hero(title=section.extra.zulma_title, primary=true) }} {% endif %}