-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from activebridge/fix/post_styles
Fix post styles
- Loading branch information
Showing
3 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
<div class="wrapper"> | ||
<div class="prev-next-posts-mob-title"><p>Read Also</p></div> | ||
<div class="posts prev-next-posts"> | ||
{% assign current_index = -1 %} | ||
{% assign posts_in_category = site.posts | where: "categories", page.category | where_exp: "item", "item.hidden != true"%} | ||
{% assign number_of_posts = posts_in_category | size %} | ||
<div class="post-content__read-also-block"> | ||
<div class="wrapper"> | ||
<div class="prev-next-posts-mob-title"><p>Read Also</p></div> | ||
<div class="posts prev-next-posts"> | ||
{% assign current_index = -1 %} | ||
{% assign posts_in_category = site.posts | where: "categories", page.category | where_exp: "item", "item.hidden != true"%} | ||
{% assign number_of_posts = posts_in_category | size %} | ||
|
||
{% for post in posts_in_category %} | ||
{% if post.url == page.url %} | ||
{% assign current_index = forloop.index0 %} | ||
{% endif %} | ||
{% endfor %} | ||
{% for post in posts_in_category %} | ||
{% if post.url == page.url %} | ||
{% assign current_index = forloop.index0 %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{% if current_index != -1 and number_of_posts > 1 %} | ||
{% assign prev_index = current_index | minus: 1 %} | ||
{% assign next_index = current_index | plus: 1 %} | ||
{% assign prev_post = posts_in_category[prev_index] %} | ||
{% assign next_post = posts_in_category[next_index] %} | ||
{% if current_index != -1 and number_of_posts > 1 %} | ||
{% assign prev_index = current_index | minus: 1 %} | ||
{% assign next_index = current_index | plus: 1 %} | ||
{% assign prev_post = posts_in_category[prev_index] %} | ||
{% assign next_post = posts_in_category[next_index] %} | ||
|
||
{% if number_of_posts == next_index%} | ||
{% assign next_post = posts_in_category[0] %} | ||
{% endif %} | ||
{% if number_of_posts == next_index%} | ||
{% assign next_post = posts_in_category[0] %} | ||
{% endif %} | ||
|
||
{% if prev_post %} | ||
{% assign name = '' %} | ||
{% assign post = prev_post %} | ||
{% include post_card.html%} | ||
{% endif %} | ||
{% if prev_post %} | ||
{% assign name = '' %} | ||
{% assign post = prev_post %} | ||
{% include post_card.html%} | ||
{% endif %} | ||
|
||
<div class="prev-next-posts__read-also"><p>Read Also</p></div> | ||
<div class="prev-next-posts__read-also"><p>Read Also</p></div> | ||
|
||
{% if next_post %} | ||
{% assign name = '' %} | ||
{% assign post = next_post %} | ||
{% include post_card.html%} | ||
{% if next_post %} | ||
{% assign name = '' %} | ||
{% assign post = next_post %} | ||
{% include post_card.html%} | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters