Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Remove buggy conditional around related posts header (mmistakes#901)
Browse files Browse the repository at this point in the history
This removes a buggy conditional that checks if `related_label` is
available in translations before displaying the header for related
posts but this header already handle missing translation by using a
default string.

With this fix the header is displayed even if the translation for this
label isn't available.

Fix mmistakes#900
  • Loading branch information
makaroniame committed Mar 16, 2017
1 parent dc6ca42 commit 8fbacc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions _layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ <h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4
{% comment %}<!-- only show related on a post page when not disabled -->{% endcomment %}
{% if page.id and page.related and site.related_posts.size > 0 %}
<div class="page__related">
{% if site.data.ui-text[site.locale].related_label %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
{% endif %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
<div class="grid__wrapper">
{% for post in site.related_posts limit:4 %}
{% include archive-single.html type="grid" %}
Expand Down
4 changes: 1 addition & 3 deletions docs/_layouts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ <h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4
{% comment %}<!-- only show related on a post page when not disabled -->{% endcomment %}
{% if page.id and page.related and site.related_posts.size > 0 %}
<div class="page__related">
{% if site.data.ui-text[site.locale].related_label %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
{% endif %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label | default: "You May Also Enjoy" }}</h4>
<div class="grid__wrapper">
{% for post in site.related_posts limit:4 %}
{% include archive-single.html type="grid" %}
Expand Down

0 comments on commit 8fbacc8

Please sign in to comment.