Remove locale hash to shorten Liquid variable names

This commit is contained in:
Michael Rose 2016-03-09 20:49:17 -05:00
parent ea8fb6fe33
commit feb504592c
6 changed files with 31 additions and 29 deletions

View file

@ -1,19 +1,21 @@
# User interface text for localization
# User interface text and labels
locale:
# English (default)
# -----------------
en: &DEFAULT_EN
pagination_previous: "Previous"
pagination_next: "Next"
toc_label: "Overview"
share_on: "Share on"
date_label: "Last Updated:"
related_label: "You May Also Enjoy"
follow_label: "Follow:"
feed_label: "Feed"
powered_by: "Powered by"
en_US:
<<: *DEFAULT_EN
en_UK:
<<: *DEFAULT_EN
# English (default)
# -----------------
en: &DEFAULT_EN
pagination_previous: "Previous"
pagination_next: "Next"
toc_label: "Overview"
share_on: "Share on"
date_label: "Last Updated:"
related_label: "You May Also Enjoy"
follow_label: "Follow:"
feed_label: "Feed"
powered_by: "Powered by"
en_US:
<<: *DEFAULT_EN
en_UK:
<<: *DEFAULT_EN
# Another locale
# --------------

View file

@ -16,15 +16,15 @@
<div class="follow">
<ul>
<li><strong>{{ site.data.ui-text.locale[site.locale].follow_label }}</strong></li>
<li><strong>{{ site.data.ui-text[site.locale].follow_label }}</strong></li>
{% if site.twitter.username %}
<li><a href="https://twitter.com/{{ site.twitter.username }}"><i class="fa fa-fw fa-twitter"></i> Twitter</a></li>
{% endif %}
{% if site.facebook.username %}
<li><a href="https://facebook.com/{{ site.facebook.username }}"><i class="fa fa-fw fa-facebook"></i> Facebook</a></li>
{% endif %}
<li><a href="{{ base_path }}/feed.xml"><i class="fa fa-fw fa-rss"></i> {{ site.data.ui-text.locale[site.locale].feed_label }}</a></li>
<li><a href="{{ base_path }}/feed.xml"><i class="fa fa-fw fa-rss"></i> {{ site.data.ui-text[site.locale].feed_label }}</a></li>
</ul>
</div>
<div class="copyright">&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.ui-text.locale[site.locale].powered_by }} <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="copyright">&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.ui-text[site.locale].powered_by }} <a href="http://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>

View file

@ -6,9 +6,9 @@
{% comment %} Link for previous page {% endcomment %}
{% if paginator.previous_page %}
{% if paginator.previous_page == 1 %}
<li><a href="{{ base_path }}/" class="btn">{{ site.data.ui-text.locale[site.locale].pagination_previous }}</a></li>
<li><a href="{{ base_path }}/" class="btn">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
{% else %}
<li><a href="{{ base_path }}/page{{ paginator.previous_page }}/" class="btn">{{ site.data.ui-text.locale[site.locale].pagination_previous }}</a></li>
<li><a href="{{ base_path }}/page{{ paginator.previous_page }}/" class="btn">{{ site.data.ui-text[site.locale].pagination_previous }}</a></li>
{% endif %}
{% endif %}
@ -59,7 +59,7 @@
{% comment %}Link next page{% endcomment %}
{% if paginator.next_page %}
<li><a href="{{ base_path }}/page{{ paginator.next_page }}/" class="btn">{{ site.data.ui-text.locale[site.locale].pagination_next }}</a></li>
<li><a href="{{ base_path }}/page{{ paginator.next_page }}/" class="btn">{{ site.data.ui-text[site.locale].pagination_next }}</a></li>
{% endif %}
</ul>
</nav>

View file

@ -1,5 +1,5 @@
<div class="social-share">
<h4>{{ site.data.ui-text.locale[site.locale].share_on }}</h4>
<h4>{{ site.data.ui-text[site.locale].share_on }}</h4>
<ul>
<li>
<a href="https://twitter.com/intent/tweet?text={{ base_path }}{{ page.url }}" class="twitter" title="Share on Twitter"><i class="fa fa-twitter"></i><span> Twitter</span></a>

View file

@ -1,5 +1,5 @@
<section id="table-of-contents" class="toc">
<header><h3><i class="fa fa-{{ include.icon | default: 'book' }}"></i> {{ include.title | default: site.data.ui-text.locale[site.locale].toc_label }}</h3></header>
<header><h3><i class="fa fa-{{ include.icon | default: 'book' }}"></i> {{ include.title | default: site.data.ui-text[site.locale].toc_label }}</h3></header>
<div id="drawer" markdown="1">
* Auto generated table of contents
{:toc}

View file

@ -27,9 +27,9 @@ layout: default
<footer role="contentinfo">
{% if site.share and page.share %}{% include social-share %}{% endif %}
{% if page.modified %}
<p class="byline"><strong>{{ site.data.ui-text.locale[site.locale].date_label }}</strong> <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time></p>
<p class="byline"><strong>{{ site.data.ui-text[site.locale].date_label }}</strong> <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time></p>
{% elsif page.date %}
<p class="byline"><strong>{{ site.data.ui-text.locale[site.locale].date_label }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time></p>
<p class="byline"><strong>{{ site.data.ui-text[site.locale].date_label }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time></p>
{% endif %}
</footer>
</div><!-- /.article-wrap -->
@ -51,7 +51,7 @@ layout: default
{% comment %}<!-- only show related on a post page when not disabled -->{% endcomment %}
{% if page.id and page.related and site.related_posts.size > 0 %}
<div class="related-articles">
<h4>{{ site.data.ui-text.locale[site.locale].related_label }}</h4>
<h4>{{ site.data.ui-text[site.locale].related_label }}</h4>
<ul>
{% for post in site.related_posts limit:3 %}
<li><a href="{{ base_path }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li>