From 6a713c6ff65507780dba1c678259801bebfbffb0 Mon Sep 17 00:00:00 2001 From: "Kyle J. Davis" Date: Fri, 19 Sep 2025 13:06:56 -0600 Subject: [PATCH 1/2] refactor community into a section Signed-off-by: Kyle J. Davis --- content/{community.md => community/_index.md} | 0 templates/community.html | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename content/{community.md => community/_index.md} (100%) diff --git a/content/community.md b/content/community/_index.md similarity index 100% rename from content/community.md rename to content/community/_index.md diff --git a/templates/community.html b/templates/community.html index 0758b941..514d138b 100644 --- a/templates/community.html +++ b/templates/community.html @@ -4,11 +4,11 @@
- {{ page.content | markdown | safe }} + {{ section.content | markdown | safe }}
- {% if page.extra.cards %} + {% if section.extra.cards %}
- {% for card in page.extra.cards %} + {% for card in section.extra.cards %}
{{ card.title }}

{{ card.title }}

From 56e5e3927d49d067c7e68e6d5434f6ec24d85549 Mon Sep 17 00:00:00 2001 From: "Kyle J. Davis" Date: Fri, 19 Sep 2025 14:15:47 -0600 Subject: [PATCH 2/2] adds ability to add custom cards Signed-off-by: Kyle J. Davis --- content/community/_index.md | 2 +- templates/community.html | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/content/community/_index.md b/content/community/_index.md index e1e9f6cf..f51b4500 100644 --- a/content/community/_index.md +++ b/content/community/_index.md @@ -2,7 +2,7 @@ title = "Community" description = "Join the Valkey community" template = "community.html" - +page_template = "community.html" [extra] cards = [ { icon = "icon-question.svg", title = "Ask Questions", description = "If you have any inquiries about Valkey, feel free to join the conversation on our GitHub discussions or chat with us on Slack.", links = [ diff --git a/templates/community.html b/templates/community.html index 514d138b..da3e52da 100644 --- a/templates/community.html +++ b/templates/community.html @@ -4,11 +4,23 @@
+ {% if section %} {{ section.content | markdown | safe }} + {% else %} + {{ page.content | markdown | safe }} + {% endif %}
- {% if section.extra.cards %} + {% set cards_meta = get_section(path="community/_index.md", metadata_only=true) %} + {% if (page and page.extra and page.extra.cards) %} + {% set page_cards = page.extra.cards %} + {% else %} + {% set page_cards = [] %} + {% endif %} + {% set cards = page_cards | concat(with= cards_meta.extra.cards) %} + + {% if cards %}
- {% for card in section.extra.cards %} + {% for card in cards%}
{{ card.title }}

{{ card.title }}