From 7c725414fa47b8cc2a863a31d63ecb92da3ee2ca Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 17 Jun 2023 11:59:36 +0200 Subject: [PATCH] Add meta tags and move plants to different folder --- {static/plants => plants}/aloe-vera/care.md | 0 .../plants => plants}/aloe-vera/metadata.toml | 0 {static/plants => plants}/aloe-vera/site.md | 0 .../chlorophytum-comosum/care.md | 0 .../chlorophytum-comosum/common-issues.md | 0 .../chlorophytum-comosum/metadata.toml | 0 .../chlorophytum-comosum/site.md | 0 .../dracaena-fragrans/care.md | 0 .../dracaena-fragrans/common-issues.md | 0 .../dracaena-fragrans/metadata.toml | 0 .../dracaena-fragrans/site.md | 0 .../monstera-deliciosa/care.md | 0 .../monstera-deliciosa/metadata.toml | 0 .../monstera-deliciosa/site.md | 0 .../spathiphyllum-wallisii/care.md | 0 .../spathiphyllum-wallisii/common-issues.md | 0 .../spathiphyllum-wallisii/metadata.toml | 0 .../spathiphyllum-wallisii/site.md | 0 templates/base.html | 7 +++++-- templates/plant.html | 18 ++++++++++++++---- templates/plants.html | 2 +- 21 files changed, 20 insertions(+), 7 deletions(-) rename {static/plants => plants}/aloe-vera/care.md (100%) rename {static/plants => plants}/aloe-vera/metadata.toml (100%) rename {static/plants => plants}/aloe-vera/site.md (100%) rename {static/plants => plants}/chlorophytum-comosum/care.md (100%) rename {static/plants => plants}/chlorophytum-comosum/common-issues.md (100%) rename {static/plants => plants}/chlorophytum-comosum/metadata.toml (100%) rename {static/plants => plants}/chlorophytum-comosum/site.md (100%) rename {static/plants => plants}/dracaena-fragrans/care.md (100%) rename {static/plants => plants}/dracaena-fragrans/common-issues.md (100%) rename {static/plants => plants}/dracaena-fragrans/metadata.toml (100%) rename {static/plants => plants}/dracaena-fragrans/site.md (100%) rename {static/plants => plants}/monstera-deliciosa/care.md (100%) rename {static/plants => plants}/monstera-deliciosa/metadata.toml (100%) rename {static/plants => plants}/monstera-deliciosa/site.md (100%) rename {static/plants => plants}/spathiphyllum-wallisii/care.md (100%) rename {static/plants => plants}/spathiphyllum-wallisii/common-issues.md (100%) rename {static/plants => plants}/spathiphyllum-wallisii/metadata.toml (100%) rename {static/plants => plants}/spathiphyllum-wallisii/site.md (100%) diff --git a/static/plants/aloe-vera/care.md b/plants/aloe-vera/care.md similarity index 100% rename from static/plants/aloe-vera/care.md rename to plants/aloe-vera/care.md diff --git a/static/plants/aloe-vera/metadata.toml b/plants/aloe-vera/metadata.toml similarity index 100% rename from static/plants/aloe-vera/metadata.toml rename to plants/aloe-vera/metadata.toml diff --git a/static/plants/aloe-vera/site.md b/plants/aloe-vera/site.md similarity index 100% rename from static/plants/aloe-vera/site.md rename to plants/aloe-vera/site.md diff --git a/static/plants/chlorophytum-comosum/care.md b/plants/chlorophytum-comosum/care.md similarity index 100% rename from static/plants/chlorophytum-comosum/care.md rename to plants/chlorophytum-comosum/care.md diff --git a/static/plants/chlorophytum-comosum/common-issues.md b/plants/chlorophytum-comosum/common-issues.md similarity index 100% rename from static/plants/chlorophytum-comosum/common-issues.md rename to plants/chlorophytum-comosum/common-issues.md diff --git a/static/plants/chlorophytum-comosum/metadata.toml b/plants/chlorophytum-comosum/metadata.toml similarity index 100% rename from static/plants/chlorophytum-comosum/metadata.toml rename to plants/chlorophytum-comosum/metadata.toml diff --git a/static/plants/chlorophytum-comosum/site.md b/plants/chlorophytum-comosum/site.md similarity index 100% rename from static/plants/chlorophytum-comosum/site.md rename to plants/chlorophytum-comosum/site.md diff --git a/static/plants/dracaena-fragrans/care.md b/plants/dracaena-fragrans/care.md similarity index 100% rename from static/plants/dracaena-fragrans/care.md rename to plants/dracaena-fragrans/care.md diff --git a/static/plants/dracaena-fragrans/common-issues.md b/plants/dracaena-fragrans/common-issues.md similarity index 100% rename from static/plants/dracaena-fragrans/common-issues.md rename to plants/dracaena-fragrans/common-issues.md diff --git a/static/plants/dracaena-fragrans/metadata.toml b/plants/dracaena-fragrans/metadata.toml similarity index 100% rename from static/plants/dracaena-fragrans/metadata.toml rename to plants/dracaena-fragrans/metadata.toml diff --git a/static/plants/dracaena-fragrans/site.md b/plants/dracaena-fragrans/site.md similarity index 100% rename from static/plants/dracaena-fragrans/site.md rename to plants/dracaena-fragrans/site.md diff --git a/static/plants/monstera-deliciosa/care.md b/plants/monstera-deliciosa/care.md similarity index 100% rename from static/plants/monstera-deliciosa/care.md rename to plants/monstera-deliciosa/care.md diff --git a/static/plants/monstera-deliciosa/metadata.toml b/plants/monstera-deliciosa/metadata.toml similarity index 100% rename from static/plants/monstera-deliciosa/metadata.toml rename to plants/monstera-deliciosa/metadata.toml diff --git a/static/plants/monstera-deliciosa/site.md b/plants/monstera-deliciosa/site.md similarity index 100% rename from static/plants/monstera-deliciosa/site.md rename to plants/monstera-deliciosa/site.md diff --git a/static/plants/spathiphyllum-wallisii/care.md b/plants/spathiphyllum-wallisii/care.md similarity index 100% rename from static/plants/spathiphyllum-wallisii/care.md rename to plants/spathiphyllum-wallisii/care.md diff --git a/static/plants/spathiphyllum-wallisii/common-issues.md b/plants/spathiphyllum-wallisii/common-issues.md similarity index 100% rename from static/plants/spathiphyllum-wallisii/common-issues.md rename to plants/spathiphyllum-wallisii/common-issues.md diff --git a/static/plants/spathiphyllum-wallisii/metadata.toml b/plants/spathiphyllum-wallisii/metadata.toml similarity index 100% rename from static/plants/spathiphyllum-wallisii/metadata.toml rename to plants/spathiphyllum-wallisii/metadata.toml diff --git a/static/plants/spathiphyllum-wallisii/site.md b/plants/spathiphyllum-wallisii/site.md similarity index 100% rename from static/plants/spathiphyllum-wallisii/site.md rename to plants/spathiphyllum-wallisii/site.md diff --git a/templates/base.html b/templates/base.html index 180d74f..68fb03a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,9 +5,12 @@ {% block head %} + - Plant Wiki - + {% block meta %} + Plant Wiki + + {% endblock meta %} {% block css %} diff --git a/templates/plant.html b/templates/plant.html index 6238e71..f1b5510 100644 --- a/templates/plant.html +++ b/templates/plant.html @@ -1,13 +1,23 @@ {% extends "base.html" %} {% import "macros.html" as macros %} +{% block meta %} +{% set data = load_data(path="/plants/" ~ page.extra.data ~ "/metadata.toml") %} + {{ page.title }} - Plant Wiki + + + {% set image = resize_image(path=data.image.url, width=512, height=255) %} + + +{% endblock meta %} + {% block css %} {{super()}} {% endblock css %} {% block content %} -{% set data = load_data(path="/static/plants/" ~ page.extra.data ~ "/metadata.toml") %} +{% set data = load_data(path="/plants/" ~ page.extra.data ~ "/metadata.toml") %}

@@ -57,7 +67,7 @@ {% endif %} {% block site %} - {{ load_data(path="/static/plants/" ~ page.extra.data ~ "/site.md") | markdown | safe }} + {{ load_data(path="/plants/" ~ page.extra.data ~ "/site.md") | markdown | safe }} {% endblock site %} @@ -77,7 +87,7 @@ {% endif %} {% block care %} - {{ load_data(path="/static/plants/" ~ page.extra.data ~ "/care.md") | markdown | safe }} + {{ load_data(path="/plants/" ~ page.extra.data ~ "/care.md") | markdown | safe }} {% endblock care %} {% if data.additional_chapters %} @@ -85,7 +95,7 @@ {% for key, chapter in data.additional_chapters %}

{{ chapter.title }}

- {{ load_data(path="/static/plants/" ~ page.extra.data ~ "/" ~ chapter.file ~ ".md") | markdown | safe }} + {{ load_data(path="/plants/" ~ page.extra.data ~ "/" ~ chapter.file ~ ".md") | markdown | safe }}
{% endfor %} {% endblock additional_chapters %} diff --git a/templates/plants.html b/templates/plants.html index 28d134d..0567894 100644 --- a/templates/plants.html +++ b/templates/plants.html @@ -14,7 +14,7 @@ {% for page in section.pages %}
- {% set data = load_data(path="/static/plants/" ~ page.extra.data ~ "/metadata.toml") %} + {% set data = load_data(path="/plants/" ~ page.extra.data ~ "/metadata.toml") %} {% set image = resize_image(path=data.image.url, width=256, height=128, op="fill") %} {{ data.image.alt }}