How to use the @tryghost/helpers.readingTime function in @tryghost/helpers

To help you get started, we’ve selected a few @tryghost/helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TryGhost / Ghost / core / frontend / helpers / reading_time.js View on Github external
module.exports = function reading_time(options) {// eslint-disable-line camelcase
    options = options || {};
    options.hash = options.hash || {};

    // only calculate reading time for posts
    if (!schema.isPost(this)) {
        return null;
    }

    let readingTime = calculateReadingTime(this, options.hash);

    return new SafeString(readingTime);
};
github chadly / ghost / core / frontend / helpers / reading_time.js View on Github external
module.exports = function reading_time(options) {// eslint-disable-line camelcase
    options = options || {};
    options.hash = options.hash || {};

    // only calculate reading time for posts
    if (!schema.isPost(this)) {
        return null;
    }

    let readingTime = calculateReadingTime(this, options.hash);

    return new SafeString(readingTime);
};
github TryGhost / gatsby-starter-ghost / src / components / common / PostCard.js View on Github external
const PostCard = ({ post }) => {
    const url = `/${post.slug}/`
    const readingTime = readingTimeHelper(post)

    return (
        
            <header>
                {post.feature_image &amp;&amp;
                    <div style="{{"></div>}
                {post.tags &amp;&amp; <div> </div>}
                {post.featured &amp;&amp; <span>Featured</span>}
                <h2>{post.title}</h2>
            </header>
            <section>{post.excerpt}</section>
            <footer>
                <div>
                    <div></div></div></footer>

@tryghost/helpers

Javascript Helpers for working with the Ghost [Content API](https://ghost.org/docs/content-api/)

MIT
Latest version published 10 days ago

Package Health Score

69 / 100
Full package analysis

Similar packages