Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toshimaru/jekyll-tagging-related_posts
Jekyll `related_posts` function based on tags.
https://github.com/toshimaru/jekyll-tagging-related_posts
gem jekyll ruby
Last synced: about 1 month ago
JSON representation
Jekyll `related_posts` function based on tags.
- Host: GitHub
- URL: https://github.com/toshimaru/jekyll-tagging-related_posts
- Owner: toshimaru
- License: mit
- Created: 2016-01-24T07:56:34.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T09:55:07.000Z (2 months ago)
- Last Synced: 2024-09-28T18:08:34.429Z (about 1 month ago)
- Topics: gem, jekyll, ruby
- Language: Ruby
- Homepage:
- Size: 57.6 KB
- Stars: 56
- Watchers: 3
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-jekyll-plugins - **Tagging Related_Posts** - tagging-related_posts](https://rubygems.org/gems/jekyll-tagging-related_posts)) -- related_posts function based on tags (Tags & Taggings, Categories & Categorizations)
README
# jekyll-tagging-related_posts
[![Test](https://github.com/toshimaru/jekyll-tagging-related_posts/actions/workflows/test.yml/badge.svg)](https://github.com/toshimaru/jekyll-tagging-related_posts/actions/workflows/test.yml)
[![Gem Version](https://badge.fury.io/rb/jekyll-tagging-related_posts.svg)](https://badge.fury.io/rb/jekyll-tagging-related_posts)
[![Test Coverage](https://codeclimate.com/github/toshimaru/jekyll-tagging-related_posts/badges/coverage.svg)](https://codeclimate.com/github/toshimaru/jekyll-tagging-related_posts/coverage)
[![Code Climate](https://codeclimate.com/github/toshimaru/jekyll-tagging-related_posts/badges/gpa.svg)](https://codeclimate.com/github/toshimaru/jekyll-tagging-related_posts)Jekyll `related_posts` function based on tags (works on Jekyll3). It replaces original Jekyll's `related_posts` function to use tags to calculate relationships.
The calculation algorithm is based on [related\_posts-jekyll\_plugin](https://github.com/LawrenceWoodman/related_posts-jekyll_plugin) by [@LawrenceWoodman](https://github.com/LawrenceWoodman).
## Installation
Add this line to your application's `Gemfile`:
```ruby
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:
```yml
gems:
- jekyll-tagging-related_posts
```Then, add `site.related_posts` in your post layout page. For example:
```liquid
{% if site.related_posts.size >= 1 %}
Related Posts
{% for related_post in site.related_posts limit: 5 %}
- {{ related_post.title }}
{% endfor %}
{% endif %}
```## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://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 the [Contributor Covenant](contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).