Skip to content

Commit

Permalink
Store text in _config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrachev committed Jan 5, 2016
1 parent 756dcce commit bd2b261
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
24 changes: 23 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ flattr_button:

# Post sharing icons
show_sharing_icons: false
share_text: 'Share this post!'
# Change to 'true' to enable individual icons
share_facebook: false
share_twitter: false
Expand All @@ -55,6 +54,29 @@ share_reddit: false
share_stumbleupon: false
share_hackernews: false

text:
pagination:
newer: 'Newer'
older: 'Older'
share_buttons:
text: 'Share this post!'
facebook: 'Share on Facebook'
twitter: 'Share on Twitter'
googleplus: 'Share on Google+'
linkedin: 'Share on LinkedIn'
digg: 'Share on Digg'
tumblr: 'Share on Tumblr'
reddit: 'Share on Reddit'
stumbleupon: 'Share on StumbleUpon'
hackernews: 'Share on Hacker News'
post:
updated: 'Updated'
minute_read: 'minute read'
related_posts: 'Related Posts'
index:
coming_soon: 'Coming soon...'


# Build settings
markdown: kramdown
redcarpet:
Expand Down
10 changes: 5 additions & 5 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<div class="left">
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item" href="{{ site.baseurl }}/">Newer</a>
<a class="pagination-item" href="{{ site.baseurl }}/">{{ site.text.pagination.newer }}</a>
{% else %}
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.previous_page}}/">Newer</a>
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.previous_page}}/">{{ site.text.pagination.newer }}</a>
{% endif %}
{% else %}
<span class="pagination-item disabled">Newer</span>
<span class="pagination-item disabled">{{ site.text.pagination.newer }}</span>
{% endif %}
</div>
<div class="right">
{% if paginator.next_page %}
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.next_page}}/">Older</a>
<a class="pagination-item" href="{{ site.baseurl }}/page{{paginator.next_page}}/">{{ site.text.pagination.older }}</a>
{% else %}
<span class="pagination-item disabled">Older</span>
<span class="pagination-item disabled">{{ site.text.pagination.older }}</span>
{% endif %}
</div>
</div>
20 changes: 10 additions & 10 deletions _includes/share_buttons.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
<div class="share-page">
{{ site.share_text }}
{{ site.text.share_buttons.text }}

<div class="share-links">
{% if site.share_facebook %}
<a class="fa fa-facebook" href="https://facebook.com/sharer.php?u={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="Share on Facebook"></a>
<a class="fa fa-facebook" href="https://facebook.com/sharer.php?u={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.facebook }}"></a>
{% endif %}

{% if site.share_twitter %}
<a class="fa fa-twitter" href="https://twitter.com/intent/tweet?text={{ page.title }}&url={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="Share on Twitter"></a>
<a class="fa fa-twitter" href="https://twitter.com/intent/tweet?text={{ page.title }}&url={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.twitter }}"></a>
{% endif %}

{% if site.share_googleplus %}
<a class="fa fa-google-plus" href="https://plus.google.com/share?url={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="Share on Google+"></a>
<a class="fa fa-google-plus" href="https://plus.google.com/share?url={{ site.url }}{{ page.url }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.googleplus }}"></a>
{% endif %}

{% if site.share_linkedin %}
<a class="fa fa-linkedin" href="http://www.linkedin.com/shareArticle?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="Share on LinkedIn"></a>
<a class="fa fa-linkedin" href="http://www.linkedin.com/shareArticle?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.linkedin }}"></a>
{% endif %}

{% if site.share_digg %}
<a class="fa fa-digg" href="http://digg.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="Share on Digg"></a>
<a class="fa fa-digg" href="http://digg.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.digg }}"></a>
{% endif %}

{% if site.share_tumblr %}
<a class="fa fa-tumblr" href="http://www.tumblr.com/share/link?url={{ site.url }}{{ page.url }}&name={{ page.title }}" rel="nofollow" target="_blank" title="Share on Tumblr"></a>
<a class="fa fa-tumblr" href="http://www.tumblr.com/share/link?url={{ site.url }}{{ page.url }}&name={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.tumblr }}"></a>
{% endif %}

{% if site.share_reddit %}
<a class="fa fa-reddit" href="http://reddit.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="Share on Reddit"></a>
<a class="fa fa-reddit" href="http://reddit.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.reddit }}"></a>
{% endif %}

{% if site.share_stumbleupon %}
<a class="fa fa-stumbleupon" href="http://www.stumbleupon.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="Share on StumbleUpon"></a>
<a class="fa fa-stumbleupon" href="http://www.stumbleupon.com/submit?url={{ site.url }}{{ page.url }}&title={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.stumbleupon }}"></a>
{% endif %}

{% if site.share_hackernews %}
<a class="fa fa-hacker-news" onclick="parent.postMessage('submit','*')" href="https://news.ycombinator.com/submitlink?u={{ site.url }}{{ page.url }}&t={{ page.title }}" rel="nofollow" target="_blank" title="Share on Hacker News"></a>
<a class="fa fa-hacker-news" onclick="parent.postMessage('submit','*')" href="https://news.ycombinator.com/submitlink?u={{ site.url }}{{ page.url }}&t={{ page.title }}" rel="nofollow" target="_blank" title="{{ site.text.share_buttons.hackernews }}"></a>
{% endif %}
</div>
</div>
8 changes: 4 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<h1>{{ page.title }}</h1>
<span class="post-meta">{{ page.date | date: site.date_format }}</span><br>
{% if page.update_date %}
<span class="post-meta">Updated: {{ page.update_date | date: site.date_format }}</span><br>
<span class="post-meta">{{ site.text.post.updated }}: {{ page.update_date | date: site.date_format }}</span><br>
{% endif %}
<span class="post-meta small">
{% if page.minutes %}
{{ page.minutes }} minute read
{{ page.minutes }} {{ site.text.post.minute_read }}
{% else %}
{{ minutes }} minute read
{{ minutes }} {{ site.text.post.minute_read }}
{% endif %}
</span>
</div>
Expand Down Expand Up @@ -55,7 +55,7 @@ <h1>{{ page.title }}</h1>
{% endif %}

{% if site.show_related_posts %}
<h3 class="related-post-title">Related Posts</h3>
<h3 class="related-post-title">{{ site.text.post.related_posts }}</h3>
{% for post in site.related_posts %}
<div class="post ml2">
<a href="{{ post.url | prepend: site.baseurl }}" class="post-link">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

{% include pagination.html %}
{% else %}
<h1 class='center'>Coming soon...</h3>
<h1 class='center'>{{ site.text.index.coming_soon }}</h3>
{% endif %}
</div>

0 comments on commit bd2b261

Please sign in to comment.