diff options
| author | Dennis Fink | 2026-06-19 18:35:56 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-06-19 18:35:56 +0200 |
| commit | cc6003d997e041127ac081e14a3213c4b898860d (patch) | |
| tree | e08ae35574e8465994953bdc3126039ecce21516 /templates/base.html | |
| parent | 41e364a3278ebe673cc851a80c206885076ed569 (diff) | |
| download | dennisfink.me-cc6003d997e041127ac081e14a3213c4b898860d.tar.gz dennisfink.me-cc6003d997e041127ac081e14a3213c4b898860d.zip | |
Add page descriptions for metadata previews
This adds a description field to blog posts and uses it for the HTML
meta description and Open Graph description, with the blog tagline
remaining as the fallback.
Archive, category, and tag pages now define their own descriptions so
previews are more specific instead of all sharing the same generic site
tagline.
Diffstat (limited to '')
| -rw-r--r-- | templates/base.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/base.html b/templates/base.html index 12e9803..0cec0b4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,8 +8,9 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="color-scheme" content="dark light"> <meta name="generator" content="lektor"> - <meta name="description" content="{{ bag('blog.tagline') }}"> - <meta property="og:description" content="{{ bag('blog.tagline') }}"> + {% set page_description = description|default(this.description|default(bag('blog.tagline'), true), true) %} + <meta name="description" content="{{ page_description }}"> + <meta property="og:description" content="{{ page_description }}"> <meta property="og:site_name" content="{{ bag('blog.name') }}"> <meta property="og:title" content="{% if (this.title or title) %}{{ (this.title or title) | safe }}{% else %}{{ bag('blog.name') }}{% endif %}"> |
