mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Update carousel to show all appropriate articles
Ensure that if articles are written by more than one author, both authors are compared to each article individually
This commit is contained in:
@@ -2,12 +2,15 @@
|
|||||||
{% assign article_list_displayed = false %}
|
{% assign article_list_displayed = false %}
|
||||||
{% for article in site.categories.articles %}
|
{% for article in site.categories.articles %}
|
||||||
{% if article.url != page.url %}
|
{% if article.url != page.url %}
|
||||||
{% for author in article.authors %}
|
{% assign authors = article.authors | split: ", " %}
|
||||||
{% for current_author in page.authors %}
|
{% for author in authors %}
|
||||||
|
{% if article.date | date: "%Y" == page.date | date: "%Y" %}
|
||||||
|
{% assign current_authors = page.authors | split: ", " %}
|
||||||
|
{% for current_author in current_authors %}
|
||||||
{% if author == current_author %}
|
{% if author == current_author %}
|
||||||
{% if article_list_displayed == false %}
|
{% if article_list_displayed == false %}
|
||||||
<h2 class="mdc-typography--headline5">
|
<h2 class="mdc-typography--headline5">
|
||||||
{% if page.authors.first %}
|
{% if current_authors.first %}
|
||||||
Other Articles By These Authors
|
Other Articles By These Authors
|
||||||
{% else %}
|
{% else %}
|
||||||
Other Articles By This Author
|
Other Articles By This Author
|
||||||
@@ -42,9 +45,12 @@
|
|||||||
{% break %}
|
{% break %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if article_list_displayed == true %}
|
||||||
<!-- close carousel -->
|
<!-- close carousel -->
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/404.html</loc>
|
<loc>/404.html</loc>
|
||||||
<lastmod>2019-03-05</lastmod>
|
<lastmod>2019-03-06</lastmod>
|
||||||
<changefreq>hourly</changefreq>
|
<changefreq>hourly</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/</loc>
|
<loc>/</loc>
|
||||||
<lastmod>2019-03-05</lastmod>
|
<lastmod>2019-03-06</lastmod>
|
||||||
<changefreq>hourly</changefreq>
|
<changefreq>hourly</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
|
|||||||
Reference in New Issue
Block a user