og and twitter card changes
This commit is contained in:
parent
3cb3f3d9bc
commit
242a5391fa
2 changed files with 16 additions and 13 deletions
|
@ -4,6 +4,7 @@
|
|||
{% block head %}
|
||||
{{ super() }}
|
||||
|
||||
<link href="{{ SITEURL }}/{{ article.url }}" rel="canonical" />
|
||||
{% for keyword in article.keywords %}
|
||||
<meta name="keywords" content="{{keyword}}" >
|
||||
{% endfor %}
|
||||
|
@ -26,23 +27,24 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block twitter_card %}
|
||||
{% for name,link in SOCIAL if name in ['twitter'] %}
|
||||
{% for name,link in SOCIAL if name.lower() in ['twitter'] %}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site" content="@{{ link|replace('http://', 'https://')|replace('https://twitter.com/', '') }}">
|
||||
<meta name="twitter:title" content="{{ article.title }}">
|
||||
<meta name="twitter:url" content="{{ SITEURL }}/{{ article.url }}">
|
||||
|
||||
{% if article.twitter_image %}
|
||||
{% if article.twitter_image|lower|truncate(4, True, '') == "http" %}
|
||||
<meta property="twitter:image" content="{{ article.twitter_image }}">
|
||||
<meta name="twitter:image:src" content="{{ article.twitter_image }}">
|
||||
{% else %}
|
||||
<meta property="twitter:image" content="{{ SITEURL }}/{{ article.twitter_image }}">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ article.twitter_image }}">
|
||||
{% endif %}
|
||||
{% elif article.header_cover %}
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/{{ article.header_cover }}">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ article.header_cover }}">
|
||||
{% elif HEADER_COVER %}
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ HEADER_COVER }}">
|
||||
{% else %}
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
|
||||
{% endif %}
|
||||
|
||||
{% if description %}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<link href="{{ SITEURL }}" rel="canonical" />
|
||||
|
||||
<!-- Feed -->
|
||||
{% for name,link in SOCIAL if name in ['rss', 'rss-square', 'feed'] %}
|
||||
{% for name,link in SOCIAL if name.lower() in ['rss', 'rss-square', 'feed'] %}
|
||||
<link href="{{ link }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
|
||||
{% else %}
|
||||
{% if FEED_ALL_ATOM %}
|
||||
|
@ -98,20 +98,21 @@
|
|||
{% else %}
|
||||
<meta name="og:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
|
||||
{% endif %}
|
||||
{% for name,link in SOCIAL if name in ['facebook'] %}
|
||||
{% for name,link in SOCIAL if name.lower() in ['facebook'] %}
|
||||
<meta property="article:publisher" content="{{ link }}" />
|
||||
{% endfor %}
|
||||
{% endblock opengraph %}
|
||||
{% block twitter_card %}
|
||||
{% for name,link in SOCIAL if name in ['twitter'] %}
|
||||
{% for name,link in SOCIAL if name.lower() in ['twitter'] %}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:site" content="@{{ link|replace('http://', 'https://')|replace('https://twitter.com/', '') }}">
|
||||
<meta name="twitter:title" content="{{ SITENAME }}">
|
||||
<meta name="twitter:description" content="{{ SITESUBTITLE|default('View the blog.') }}">
|
||||
<meta name="twitter:url" content="{{ SITEURL }}">
|
||||
{% if HEADER_COVER %}
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/{{ HEADER_COVER }}">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ HEADER_COVER }}">
|
||||
{% else %}
|
||||
<meta name="twitter:image" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
|
||||
<meta name="twitter:image:src" content="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock twitter_card %}
|
||||
|
@ -132,8 +133,8 @@
|
|||
<footer id="footer">
|
||||
<div class="inner">
|
||||
<section class="credits">
|
||||
<span class="credits-theme">Theme <a href="https://github.com/arulrajnet/attila">Attila</a></span>
|
||||
<span class="credits-software">Published with <a href="https://github.com/getpelican/pelican">Pelican</a></span>
|
||||
<span class="credits-theme">Theme <a href="https://github.com/arulrajnet/attila" rel="nofollow">Attila</a></span>
|
||||
<span class="credits-software">Published with <a href="https://github.com/getpelican/pelican" rel="nofollow">Pelican</a></span>
|
||||
</section>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue