From 6d860c0c458f8164c09a943116a874a611b9a4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vedran=20Mileti=C4=87?= Date: Sat, 4 Sep 2021 15:58:26 +0200 Subject: [PATCH] Documented the displaying of metadata in page body --- docs/reference/meta-tags.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/reference/meta-tags.md b/docs/reference/meta-tags.md index 38df1f4e8..7304472eb 100644 --- a/docs/reference/meta-tags.md +++ b/docs/reference/meta-tags.md @@ -85,6 +85,25 @@ extra: ## Customization +### Displaying the metadata + +Sometimes it's useful to be able to display the medatada in the page body, e.g. +print the name of the page author at the bottom of the page. To achieve that, +you can [extend the theme][7] by adding the following contents to `main.html`: + +``` html +{% extends "base.html" %} + +{% block content %} + {{ super() }} + {% if page and page.meta and page.meta.author %} +

Author: {{ page.meta.author }}

+ {% endif %} +{% endblock %} +``` + + [7]: ../customization.md#extending-the-theme + ### Custom meta tags #### on all pages @@ -99,7 +118,6 @@ policies for search engines: {% endblock %} ``` - [7]: ../customization.md#extending-the-theme [8]: ../customization.md#overriding-blocks-recommended #### on a single page