Add plugin for automatic hyphenation

This commit is contained in:
2016-01-18 14:16:57 +00:00
parent 33a0f04a9b
commit afbafc3ee8
9 changed files with 52 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
<div style="width: {{ include.width }}px;" class="caption">
<img src="{{ include.image }}" />
{% if include.text %}
{{ include.text|markdownify }}
{{ include.text | markdownify | hyphenate }}
{% endif %}
</div>

View File

@@ -5,7 +5,6 @@
var disqus_identifier = '{{ page.id }}';
var disqus_title = '{{ page.title|replace:"'":"\\'" }}';
var disqus_url = '{{ site.absolute }}{{ page.url }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';

View File

@@ -1,22 +0,0 @@
<section itemscope itemtype="http://schema.org/BlogPosting">
<header>
<div class="timeline">
{% if post.date %}
<time datetime="{{ post.date|date_to_xmlschema }}" title="{{ post.date|date_to_xmlschema }}"><strong>{{ post.date|date:"%b %d"|upcase }}</strong><br />{{ post.date|date:"%Y" }}</time>
{% endif %}
{% if post.location %}
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ post.location.latitude }},{{ post.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ post.location.latitude }},{{ post.location.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ post.location.title }}" width="49" /></a>
{% endif %}
{% if post.code %}
<a href="{{ post.code }}"><img alt="code" height="49" src="{{ site.static_prefix }}/icon/code.png" width="49" /></a>
{% endif %}
</div>
<h1>
<span itemprop="name">{{ post.title }}</span>
<small class="print-only" itemprop="datePublished" content="{{ post.date|date:'%F') }}">{{ post.date|date:'%A, %B %d, %Y' }}</small>
</h1>
</header>
<section class="post-content" itemprop="articleBody">
{{ post.content }}
</section>
</section>

View File

@@ -17,16 +17,16 @@
</h1>
</header>
<section class="post-content" itemprop="articleBody">
{{ post.excerpt }}
{{ post.excerpt | hyphenate }}
{% capture content_words %}
{{ post.content | number_of_words }}
{% endcapture %}
{% endcapture %}
{% capture excerpt_words %}
{{ post.excerpt | number_of_words }}
{% endcapture %}
{% endcapture %}
{% if excerpt_words != content_words %}
<p>
<a href="/{{ site.baseurl }}{{ post.url }}" class="read-more" role="button">{{ site.read_more }}</a>
<a href="/{{ site.baseurl }}{{ post.url }}#more" class="read-more" role="button">{{ site.read_more }}</a>
</p>
{% endif %}
</section>