Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Jekyll `related_posts` function based on tags.

License

NotificationsYou must be signed in to change notification settings

toshimaru/jekyll-tagging-related_posts

Repository files navigation

TestGem VersionTest CoverageCode Climate

Jekyllrelated_posts function based on tags (works on Jekyll3). It replaces original Jekyll'srelated_posts function to use tags to calculate relationships.

The calculation algorithm is based onrelated_posts-jekyll_plugin by@LawrenceWoodman.

Installation

Add this line to your application'sGemfile:

gem'jekyll-tagging-related_posts'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jekyll-tagging-related_posts

Usage

Edit_config.yml to use the plug-in:

gems:  -jekyll-tagging-related_posts

Then, addsite.related_posts in your post layout page. For example:

{%ifsite.related_posts.size>=1 %}<div>  <h3>Related Posts</h3>  <ul>  {%forrelated_postinsite.related_postslimit:5 %}    <li><ahref="{{related_post.url }}">{{related_post.title }}</a></li>  {%endfor %}  </ul></div>{%endif %}

Development

After checking out the repo, runbin/setup to install dependencies. Then, runrake test to run the tests. You can also runbin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub athttps://github.com/toshimaru/jekyll-tagging-related_posts/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to theContributor Covenant code of conduct.

License

The gem is available as open source under the terms of theMIT License.

About

Jekyll `related_posts` function based on tags.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp