Improvments.

- Better messages
- X min read
- pt_BR translation
- Better style for read more
This commit is contained in:
Alexandre Vicenzi 2016-08-10 23:20:35 -03:00
parent df41de5f6a
commit 549a882acb
14 changed files with 196 additions and 100 deletions

View file

@ -14,11 +14,13 @@
<header>
<h1 id="{{ article.slug }}">{{ article.title }}</h1>
<p>
{% autoescape false %}
{{ _('Posted on %(when)s in %(category)s',
when=article.locale_date,
category='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category)) }}
{% endautoescape %}
{% with category_url='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category) %}
{{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }}
{% endwith %}
{% if 'post_stats' in PLUGINS %}
&#8226; {{ article.stats['read_mins'] }} min read
{% endif %}
</p>
</header>
<div>
@ -33,6 +35,7 @@
{% endif %}
</p>
</div>
{% if ADD_THIS_ID %}
<div class="center social-share">
<p>{{ _('Like this article? Share it with your friends!') }}</p>
@ -40,20 +43,18 @@
<div class="addthis_sharing_toolbox"></div>
</div>
{% endif %}
{% if article.related_posts %}
<div class="related-posts">
<h4>{{ _('Related posts') }}:</h4>
<ul>
<h4>{{ _('You might enjoy') }}</h4>
<ul class="related-posts">
{% for related_post in article.related_posts %}
<li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% include "partial/disqus.html" %}
</article>
{% endblock %}
{% block additional_js %}
{% include "partial/jsonld_article.html" %}
{% endblock %}

View file

@ -68,19 +68,23 @@
{% endif %}
</a>
<h1><a href="{{ SITEURL }}">{{ SITETITLE }}</a></h1>
{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}
{% if pages or LINKS %}
<nav>
<ul class="list">
{% for page in pages|sort(attribute='title') %}
<li><a href="{{ SITEURL }}/{{ page.url }}#{{ page.slug }}">{{ page.title }}</a></li>
{% endfor %}
{% for name, link in LINKS %}
<li><a href="{{ link }}" target="_blank">{{ name }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
<ul class="social">
{% for name, link in SOCIAL %}
<li><a class="sc-{{ name }}" href="{{ link }}" target="_blank"><i class="fa fa-{{ name }}"></i></a></li>
@ -91,15 +95,18 @@
<main>
{% if MAIN_MENU %}
<nav>
<a href="{{ SITEURL }}">Home</a>
<a href="{{ SITEURL }}">{{ _('Home') }}</a>
{% for title, link in MENUITEMS %}
<a href="{{ link }}">{{ title }}</a>
{% endfor %}
{% if FEED_ALL_ATOM %}
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}">Atom</a>
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}">{{ _('Atom') }}</a>
{% endif %}
{% if FEED_ALL_RSS %}
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}">RSS</a>
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}">{{ _('RSS') }}</a>
{% endif %}
</nav>
{% endif %}
@ -111,11 +118,7 @@
{% if CC_LICENSE %}
{% include "partial/cc_license.html" %}
{% else %}
<p>&copy; {{ AUTHOR }} {{ COPYRIGHT_YEAR }}</p>
{% include "partial/flex.html" %}
{% if STATUSCAKE %}
{% include "partial/statuscake.html" %}
{% endif %}
{% include "partial/copyright.html" %}
{% endif %}
</footer>
</main>

View file

@ -1,3 +1,3 @@
{% extends "index.html" %}
{% block title %} &ndash; {{ _('Category: %(name)s', name=category) }}{% endblock %}
{% block title %} &ndash; {{ _('Category %(name)s', name=category) }}{% endblock %}
{% set summarise = True %}

View file

@ -6,25 +6,19 @@
<header>
<h2><a href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ article.title }}</a></h2>
<p>
{% autoescape false %}
{{ _('Posted on %(when)s in %(category)s',
when=article.locale_date,
category='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category)) }}
{% endautoescape %}
{% if article.tags %}
&#8226; {{ ngettext('Tag', 'Tags', article.tags|count) }}:
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
{% if DISQUS_SITENAME %}
&#8226; <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">{{ _('Leave a comment') }}</a>
{% with category_url='<a href="%s/%s">%s</a>' % (SITEURL, article.category.url, article.category) %}
{{ _('Posted on %(when)s in %(category)s', when=article.locale_date, category=category_url|safe) }}
{% endwith %}
{% if 'post_stats' in PLUGINS %}
&#8226; {{ article.stats['read_mins'] }} min read
{% endif %}
</p>
</header>
<div>
{% if summarise or article.metadata['summary'] or SUMMARY_MAX_LENGTH %}
{{ article.summary }}
<br>
<a class="btn" href="{{ SITEURL }}/{{ article.url }}#{{ article.slug }}">{{ _('Continue reading') }}</a>
{% else %}
{{ article.content }}
@ -38,7 +32,3 @@
{% include "partial/pagination.html" %}
{% endblock %}
{% block additional_js %}
{% include "partial/disqus_count.html" %}
{% endblock %}

View file

@ -0,0 +1,5 @@
<p>&copy; {{ AUTHOR }} {{ COPYRIGHT_YEAR }}</p>
{% include "partial/flex.html" %}
{% if STATUSCAKE %}
{% include "partial/statuscake.html" %}
{% endif %}

View file

@ -9,10 +9,6 @@
})();
</script>
<noscript>
{% autoescape false %}
{{ _('Please enable JavaScript to view the %(link)scomments powered by Disqus%(endlink)s',
link='<a href="https://disqus.com/?ref_noscript" rel="nofollow">',
endlink='</a>') }}
{% endautoescape %}
{{ _('Please enable JavaScript to view comments.') }}
</noscript>
{% endif %}

View file

@ -1,11 +0,0 @@
{% if DISQUS_SITENAME %}
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SITENAME }}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endif %}

View file

@ -1,6 +1,4 @@
{% autoescape false %}
<p>{{ _('Build using %(pelican)s - %(flex)s theme by %(alexandrevicenzi)s',
pelican='<a href="http://getpelican.com" target="_blank">Pelican</a>',
flex='<a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a>',
alexandrevicenzi='<a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a>') }}</p>
{% endautoescape %}
<p>{{ _('Powered by %(pelican_url)s - %(flex_url)s theme by %(alexandrevicenzi_url)s',
pelican_url='<a href="http://getpelican.com" target="_blank">Pelican</a>',
flex_url='<a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a>'|safe,
alexandrevicenzi_url='<a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a>'|safe) }}</p>

View file

@ -1,3 +1,3 @@
{% extends "index.html" %}
{% block title %} &ndash; {{ _('Tag: %(name)s', name=tag) }}{% endblock %}
{% block title %} &ndash; {{ _('Tag %(name)s', name=tag) }}{% endblock %}
{% set summarise = True %}