pelican-mg/templates/article.html

109 lines
6.2 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ article.title|striptags }}{% endblock %}
{% block description %}{{ article.summary|striptags|e }}{% endblock %}
{% block seo %}
<meta property="og:title" content="{{ article.title|capitalize }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
<meta name="twitter:title" content="{{ article.title|capitalize }}" />
<meta name="twitter:url" content="{{ SITEURL }}/{{ article.url }}" />
<meta itemprop="url" content="{{ SITEURL }}/{{ article.url }}" />
{% if article.summary %}
<meta property="og:description" content="{{ article.summary|striptags|e }}" />
<meta name="twitter:description" content="{{ article.summary|striptags|e }}" />
{% endif %}
{% if article.date %}
<meta property="og:article:published_time" content="{{ article.date.strftime('%Y-%m-%d') }}" />
{% endif %}
{% if article.modified %}
<meta property="og:article:modified_time" content="{{ article.modified.strftime('%Y-%m-%d') }}">
<meta itemprop="dateModified" content="{{ article.date.strftime('%Y-%m-%d') }}" />
{% endif %}
{% if article.author %}
<meta property="og:article:author" content="{{ article.author }}" >
{% endif %}
{% for tag in article.tags %}
<meta property="og:article:tag" content="{{ tag }}">
{% endfor %}
{% if article.image %}
<meta property="og:image" content="{{ article.image }}" />
<meta name="twitter:image" content="{{ article.image }}" />
<meta itemprop="image" content="{{ article.image }}"/>
{% elif META_IMAGE %}
<meta property="og:image" content="{{ META_IMAGE }}" />
<meta property="og:image:type" content="{{ META_IMAGE_TYPE }}" />
<meta name="twitter:image" content="{{ META_IMAGE }}" />
<meta itemprop="image" content="{{ META_IMAGE }}" />
{% endif %}
{% endblock %}
{% block content %}
<div class="mg-container-social uk-width-medium-1-10 uk-hidden-small">
{% if SHARE %}
<div class="uk-panel" id="mg-panel-social">
<ul class="uk-nav uk-nav-side">
<li>
<a href="https://www.facebook.com/sharer/sharer.php?u={{ SITEURL }}/{{ article.url }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" target="_blank" class="uk-button"><i class="uk-icon-facebook-square"></i> Share</a>
</li>
<li>
<a href="https://twitter.com/intent/tweet?text={{ article.title|striptags|urlencode }}&url={{ SITEURL }}/{{ article.url }}&via={{ TWITTER_USERNAME }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" class="uk-button" target="_blank"><i class="uk-icon-twitter"></i> Tweet</a>
</li>
<li>
<a href="https://plus.google.com/share?url={{ SITEURL }}/{{ article.url }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank" class="uk-button"><i class="uk-icon-google-plus-square"></i> Share</a>
</li>
</ul>
</div>
{% endif %}
</div>
<div class="uk-width-medium-7-10">
<article class="uk-article">
<h1 class="uk-heading-large uk-article-title" itemprop="name">{{ article.title }}</h1>
<p class="uk-article-meta">
<time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time>
{% if CATEGORY_SAVE_AS %}<a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% endif %}
{% if DISQUS_SITENAME %}, <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}
</p>
{% if SHARE %}
<a href="https://www.facebook.com/sharer/sharer.php?u={{ SITEURL }}/{{ article.url }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" target="_blank" class="uk-button uk-visible-small"><i class="uk-icon-facebook-square"></i> Share</a>
<a href="https://twitter.com/intent/tweet?text={{ article.title|striptags|urlencode }}&url={{ SITEURL }}/{{ article.url }}&via={{ TWITTER_USERNAME }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" class="uk-button uk-visible-small" target="_blank"><i class="uk-icon-twitter"></i> Tweet</a>
<a href="https://plus.google.com/share?url={{ SITEURL }}/{{ article.url }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank" class="uk-button uk-visible-small"><i class="uk-icon-google-plus-square"></i> Share</a>
{% endif %}
{% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>{% endif %}
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
{% include "partials/inline-tags.html" %}
<hr class="uk-article-divider">
</article>
{% if DISQUS_SITENAME %}
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ DISQUS_SITENAME }}'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{% endif %}
{% if ISSO_BASE_URL %}
<script data-isso="{{ ISSO_BASE_URL }}/" src="{{ ISSO_BASE_URL }}/js/embed.dev.js"></script>
<section id="isso-thread"></section>
{% endif %}
</div>
{% endblock %}