Add meta tags and move plants to different folder

main
trivernis 1 year ago
parent cfea7db72b
commit 7c725414fa
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: DFFFCC2C7A02DB45

@ -5,9 +5,12 @@
{% block head %}
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<meta name="language" content="en" />
<title>Plant Wiki</title>
<meta name="description" content="I put my houseplants here." />
{% block meta %}
<title>Plant Wiki</title>
<meta name="description" content="I put my houseplants here." />
{% endblock meta %}
{% block css %}
<link href="{{ get_url(path="style.css", trailing_slashes=false) | safe }}" rel="stylesheet">

@ -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") %}
<title>{{ page.title }} - Plant Wiki</title>
<meta name="description" content="Information about {{ page.title }} ({{ data.bin_name }})" />
{% set image = resize_image(path=data.image.url, width=512, height=255) %}
<meta name="og:image" content="{{ image.url }}" />
<meta name="og:image:alt" content="{{ data.image.alt }}" />
{% endblock meta %}
{% block css %}
{{super()}}
<link href="{{ get_url(path="plant.css", trailing_slashes=false) | safe }}" rel="stylesheet">
{% 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") %}
<div class="card">
<h1 class="title">
@ -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 %}
</section>
@ -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 %}
<section>
<a href="#{{ chapter.title | slugify }}"><h2 id="{{ chapter.title | slugify }}">{{ chapter.title }}</h2></a>
{{ 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 }}
</section>
{% endfor %}
{% endblock additional_chapters %}

@ -14,7 +14,7 @@
{% for page in section.pages %}
<div class="plant-item-wrapper">
<div class="plant-item">
{% 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") %}
<a class="plant-link" href="{{ page.permalink | safe }}">
<img class="plant-image" src="{{ image.url }}" alt="{{ data.image.alt }}">

Loading…
Cancel
Save