Skip to content

Commit 45c3d91

Browse files
authored
Added related_posts false to the announcements front matter (alshedivat#1266)
Added `related_posts: false` to the announcements front matter to avoid errors like alshedivat#1203. Also included explanation in README FAQ section.
1 parent 1701a23 commit 45c3d91

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,15 @@ If you have a different question, please ask using [Discussions](https://github.
389389
RSS Feed plugin works with these correctly set up fields: `title`, `url`, `description` and `author`.
390390
Make sure to fill them in an appropriate way and try again.
391391

392+
5. **Q:** My site doesn't work when I enable `related_blog_posts`. Why? <br>
393+
**A:** This is probably due to the [classifier reborn](https://github.com/jekyll/classifier-reborn) plugin, which is used to calculate
394+
related posts. If the error states `Liquid Exception: Zero vectors can not be normalized...`, it means that it could not calculate related
395+
posts for a specific post. This is usually caused by [empty or really small blog posts](https://github.com/jekyll/classifier-reborn/issues/64)
396+
without meaningful words (i.e. only [stop words](https://en.wikipedia.org/wiki/Stop_words)) or even
397+
[specific characters](https://github.com/jekyll/classifier-reborn/issues/194) you used in your posts. Also, the calculus for similar posts are
398+
made for every `post`, which means every page that uses `layout: post`, including the announcements. To change this behavior, simply add
399+
`related_posts: false` to the front matter of the page you don't want to display related posts on.
400+
392401

393402
## Features
394403

_news/announcement_1.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
date: 2015-10-22 15:59:00-0400
44
inline: true
5+
related_posts: false
56
---
67

78
A simple inline announcement.

_news/announcement_2.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: post
33
title: A long announcement with details
44
date: 2015-11-07 16:11:00-0400
55
inline: false
6+
related_posts: false
67
---
78

89
Announcements and news can be much longer than just quick inline posts. In fact, they can have all the features available for the standard blog posts. See below.

_news/announcement_3.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: post
33
date: 2016-01-15 07:59:00-0400
44
inline: true
5+
related_posts: false
56
---
67

78
A simple inline announcement with Markdown emoji! :sparkles: :smile:

0 commit comments

Comments
 (0)