Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyzwezdin committed Jul 2, 2016
1 parent b0dc4a5 commit eebe4a6
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pretzel.SimilarPosts

Allows you find similar posts for your blog and add "It's may be interested for you" links to your blog pages.
Allows you find similar posts for your blog and add `It's may be interested for you` links to your blog pages.

This is a plugin for the static site generation tool [Pretzel](https://github.com/Code52/pretzel).

Expand All @@ -26,7 +26,28 @@ similar_posts:
- vs.net
```

Configuration parameters are:
- `filter_threshold` is param to define threshold for posts, it could be number from `0` to `1`.
- `related_count` is param to define related posts count for each page.
- `weight` is param to determine weight of different factors in comparision process. It accepts numbers from `0` to `1`. In this version the plugin is able to compare by `category`, `tag`, `title` and `text` (blog post content).
- `stemmers` is param to define which stemmers to use to pre-process the text. The plugin uses [StemmersNet](https://stemmersnet.codeplex.com/) library for that. If you're using another language feel free to add additional languages [availeable](https://stemmersnet.codeplex.com/) at StemmersNet.
- `reserved` is param to define reserver words whcih won't be processed. During the comparision process all non-alphanumeric symbols will be removed. It's fine for most cases. But it's wrong for some situations like `asp.net` word. If we won't add it to `reserved` list the plugin will understand it as two different words `asp` and `net`, which is wrong. So we add it to `reserved` list and plugin won't pre-process it at all.

Once we configure the plugin in `_config.yml` there will be available `page.related` variable for each page. To use it add code like this into your `post.html` file:

```html
{% if page.related.size > 0 -%}
<section class="related">
<h4>You may be interested in</h4>
<ul>
{% for page in page.related -%}
<li><a href="/{{page.url}}">{{page.title}}</a></li>
{% endfor -%}
</ul>
</section>
{% endif -%}

```

### Installation

Expand Down

0 comments on commit eebe4a6

Please sign in to comment.