Repos / pytaku / 456e37d3f0
commit 456e37d3f0d00bfa2e778ed203dc76c37b9fe56d
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Tue Aug 11 21:28:26 2020 +0700
make sure there's something in og:description
Otherwise opengraph crawlers may pick up some unrelated block (e.g.
footer text) for description instead.
diff --git a/src/pytaku/templates/chapter.html b/src/pytaku/templates/chapter.html
index ffebe6f..d2061b2 100644
--- a/src/pytaku/templates/chapter.html
+++ b/src/pytaku/templates/chapter.html
@@ -7,7 +7,7 @@
{% block head %}
<meta property="og:title" content="{{ title['name'] }} {{ self.title() }} - Pytaku" />
<meta property="og:image" content="{{ title['cover'] }}" />
-<meta property="og:description" content="{{ title['descriptions'] | join('\n') }}" />
+<meta property="og:description" content="{{ title['descriptions'] | join('\n') or '(no description)' }}" />
{% if next_chapter %}
<link rel="prefetch" href="{{ url_for('chapter_view', site=site, title_id=title_id, chapter_id=next_chapter['id'])}}">
diff --git a/src/pytaku/templates/title.html b/src/pytaku/templates/title.html
index 559d939..ce0095e 100644
--- a/src/pytaku/templates/title.html
+++ b/src/pytaku/templates/title.html
@@ -3,7 +3,7 @@
{% block head %}
<meta property="og:title" content="{{ name }} - Pytaku" />
<meta property="og:image" content="{{ cover }}" />
-<meta property="og:description" content="{{ descriptions | join('\n') }}" />
+<meta property="og:description" content="{{ descriptions | join('\n') or '(no description)' }}" />
<style>
.cover {