Skip to content

Commit

Permalink
replace third party reading time with native ghost function
Browse files Browse the repository at this point in the history
  • Loading branch information
zutrinken committed Nov 11, 2017
1 parent dc2ccec commit bb5b3e4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 41 deletions.
2 changes: 1 addition & 1 deletion assets/js/dependencies.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/script.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions bower.json
Expand Up @@ -8,7 +8,6 @@
"jquery": "~2.1.4",
"masonry": "~3.3.2",
"normalize.css": "~3.0.3",
"nprogress": "~0.2.0",
"reading-time": "~1.0.0"
"nprogress": "~0.2.0"
}
}
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,9 +2,9 @@
"name": "bleak",
"description": "Ghost Theme",
"demo": "http://bleak.zutrinken.com",
"version": "1.1.0",
"version": "1.1.1",
"engines": {
"ghost": ">=1.0.0"
"ghost": ">=1.17.0"
},
"license": "MIT",
"screenshots": {
Expand Down
22 changes: 11 additions & 11 deletions post.hbs
Expand Up @@ -10,22 +10,22 @@

<header class="post-header">
<span class="post-meta">
<span class="post-meta-author">{{author}}</span> | <span class="post-meta-date">{{date format="DD MMM YYYY"}} <span class="post-meta-reading-time">| <span class="estimated-reading-time"></span> (<span class="word-count"></span> words)</span></span>
<span class="post-meta-author">{{author}}</span> | <span class="post-meta-date">{{date format="DD MMM YYYY"}}</span> | <span class="post-meta-reading-time">{{reading_time}}</span>
</span>
<div class="clear"></div>
<h1 class="post-title">{{{title}}}</h1>
</header>

<section class="post-content">
{{content}}
</section>

<footer class="post-footer">

<div class="post-tags">
{{tags separator=" "}}
</div>

<div class="post-share">
<a class="icon-twitter" href="https://twitter.com/share?text={{title}}&url={{url absolute="true"}}" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;">
<span>Twitter</span>
Expand All @@ -37,9 +37,9 @@
<span>Google+</span>
</a>
</div>

</footer>

{{#author}}
<aside class="post-author">
{{#if profile_image}}
Expand Down Expand Up @@ -70,20 +70,20 @@
<div class="clear"></div>
</aside>
{{/author}}

{{#if @labs.subscribers}}
<aside class="post-subscribe">
<p>Get the latest posts delivered right to your inbox.</p>
{{subscribe_form placeholder="Your email address" form_class="post-subscribe-form" input_class="post-subscribe-input" button_class="post-subscribe-button"}}
</aside>
{{/if}}

<aside class="post-comments">
<div id="disqus_thread"></div>
</aside>

</div>

<nav class="post-nav">
{{#next_post}}
<a class="post-nav-item post-nav-next" href="{{url absolute="true"}}">
Expand Down Expand Up @@ -113,4 +113,4 @@
{{/post}}
</div>
</article>
</main>
</main>
24 changes: 0 additions & 24 deletions src/js/script.js
Expand Up @@ -144,29 +144,6 @@ jQuery(function($) {
}
comments();

/* ==========================================================================
Reading Time
========================================================================== */

function readingTime() {
// Don't execute on the front page
if (location.pathname === '/') {
return;
}

var post = body.find('article');
var postReadingTime = post.find('.post-meta-reading-time');

post.readingTime({
readingTimeTarget: postReadingTime.find('.estimated-reading-time'),
wordCountTarget: postReadingTime.find('.word-count'),
error: function () {
postReadingTime.find('.post-reading-time').remove();
}
});
}
readingTime();

/* ==========================================================================
Reload all scripts after AJAX load
========================================================================== */
Expand All @@ -178,7 +155,6 @@ jQuery(function($) {
video();
comments();
currentMenuFix();
readingTime();
}

/* ==========================================================================
Expand Down

0 comments on commit bb5b3e4

Please sign in to comment.