1
0
Fork 0
forked from github/pelican

Merge pull request #2724 from getpelican/theme-metadata

Put article summary in notmyidea "description" HTML metadata tag
This commit is contained in:
Justin Mayer 2020-04-16 07:03:57 +02:00 committed by GitHub
commit adf12505ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 51 additions and 0 deletions

View file

@ -6,6 +6,7 @@
<title>A markdown powered article</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="You're mutually oblivious. a root-relative link to unbelievable a file-relative link to unbelievable" />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>Article 1</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Article 1" />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>Article 2</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Article 2" />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>Article 3</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Article 3" />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>A draft article without date</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>A draft article</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>FILENAME_METADATA example</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Some cool stuff!" />
</head>
<body id="index" class="home">

View file

@ -8,6 +8,7 @@
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="en" href="/oh-yeah.html">
<meta name="description" content="Et voila du contenu en français" />
</head>
<body id="index" class="home">

View file

@ -8,6 +8,7 @@
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="fr" href="/oh-yeah-fr.html">
<meta name="description" content="Why not ? After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !" />
</head>
<body id="index" class="home">

View file

@ -8,6 +8,7 @@
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="en" href="/second-article.html">
<meta name="description" content="Ceci est un article, en français." />
</head>
<body id="index" class="home">

View file

@ -8,6 +8,7 @@
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<link rel="alternate" hreflang="fr" href="/second-article-fr.html">
<meta name="description" content="This is some article, in english" />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>The baz tag</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="This article overrides the listening of the articles under the baz tag." />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>This is a super article !</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Multi-line metadata should be supported as well as inline markup." />
</head>
<body id="index" class="home">

View file

@ -6,6 +6,7 @@
<title>Unbelievable !</title>
<link rel="stylesheet" href="/theme/css/main.css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="A Pelican Blog Atom Feed" />
<meta name="description" content="Or completely awesome. Depends the needs. a root-relative link to markdown-article a file-relative link to markdown-article Testing sourcecode..." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="You're mutually oblivious. a root-relative link to unbelievable a file-relative link to unbelievable" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 1" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 2" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 3" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Some cool stuff!" />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./oh-yeah.html">
<meta name="description" content="Et voila du contenu en français" />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="./oh-yeah-fr.html">
<meta name="description" content="Why not ? After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !" />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./second-article.html">
<meta name="description" content="Ceci est un article, en français." />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="./second-article-fr.html">
<meta name="description" content="This is some article, in english" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This article overrides the listening of the articles under the baz tag." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Multi-line metadata should be supported as well as inline markup." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="./theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Or completely awesome. Depends the needs. a root-relative link to markdown-article a file-relative link to markdown-article Testing sourcecode..." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else." />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./posts/2010/octobre/20/oh-yeah/">
<meta name="description" content="Et voila du contenu en français" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Multi-line metadata should be supported as well as inline markup." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Or completely awesome. Depends the needs. a root-relative link to markdown-article a file-relative link to markdown-article Testing sourcecode..." />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="../../../../../oh-yeah-fr.html">
<meta name="description" content="Why not ? After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="You're mutually oblivious. a root-relative link to unbelievable a file-relative link to unbelievable" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 1" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 2" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Article 3" />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="fr" href="../../../../../second-article-fr.html">
<meta name="description" content="This is some article, in english" />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../../../../../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="Some cool stuff!" />
</head>
<body id="index" class="home">

View file

@ -9,6 +9,7 @@
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<link rel="alternate" hreflang="en" href="./posts/2012/février/29/second-article/">
<meta name="description" content="Ceci est un article, en français." />
</head>
<body id="index" class="home">

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="../theme/css/main.css" />
<link href="http://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log Atom Feed" />
<link href="http://blog.notmyidea.org/feeds/all.rss.xml" type="application/rss+xml" rel="alternate" title="Alexis' log RSS Feed" />
<meta name="description" content="This article overrides the listening of the articles under the baz tag." />
</head>
<body id="index" class="home">

View file

@ -1,5 +1,12 @@
{% extends "base.html" %}
{% block html_lang %}{{ article.lang }}{% endblock %}
{% block head -%}
{{ super() -}}
{% if article.summary %}
<meta name="description" content="{{ article.summary | striptags | safe | truncate(150) }}" />
{% endif %}
{% endblock %}
{% block title %}{{ article.title|striptags }}{% endblock %}
{% block extra_head %}

View file

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
<head>
{% block head %}
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
@ -12,6 +13,7 @@
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% block extra_head %}{% endblock extra_head %}
{% endblock head %}
</head>
<body id="index" class="home">