Skip to content

zuchmanski/jekyll-only_first_p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Requirements

The truncator requires Nokogiri to parse out the HTML string.

Usage

If you're using Jekyll, add the only_first_p.rb file to your _plugins directory - this will give you the helper only_first_p as a Liquid filter. In your views, you can use this function in order to show only first paragraph of page/post

page | only_first_p

Default output

<p>
{first paragraph content}
</p><a class="readmore" href="{post-url}">Read more</a>

Configuration

You can choose whether to output a 'Read more' link and the link text to use.

Update your _config.yml as required.

# Only First P Plugin
only_first_p:
    show_read_more_link: true
    read_more_link_text: 'Read more'

The above is the default configuration and will be used if nothing is specified. Modify as needed.

About

Display only first paragraph of post

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages