Skip to content

Commit

Permalink
add homepage order to frontmatter of promoted categories:
Browse files Browse the repository at this point in the history
  • Loading branch information
Heather committed Mar 19, 2020
1 parent 7d49dee commit 7c57701
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
1 change: 1 addition & 0 deletions _categories/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: basics
title: "About COVID-19"
promoted: true
homepage_order: 1
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/healthcare-infection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: healthcare-infection
title: "Healthcare infection"
promoted: true
homepage_category: 6
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/healthcare-professionals.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: healthcare-professionals
title: "Healthcare professionals"
promoted: true
homepage_order: 6
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/protect-yourself.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: protect-yourself
title: "How to protect yourself"
promoted: true
homepage_order: 2
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/spread.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: spread
title: "How it spreads"
promoted: true
homepage_order: 4
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/symptoms-and-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: symptoms-and-testing
title: "Symptoms and testing"
promoted: true
homepage_order: 3
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
1 change: 1 addition & 0 deletions _categories/travel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: category
name: travel
title: "Traveling"
promoted: true
homepage_order: 5
banner:
display: false
heading: "This is a place to place urgent information"
Expand Down
36 changes: 18 additions & 18 deletions _includes/content-questions.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

<section class="grid-container usa-section usa-section--condensed border-top border-base-lightest">
<div class="grid-row grid-gap">
{% assign categories = site.content | group_by:"category" %}
{% assign promoted_site_categories = site.categories | where: "promoted", "true" %}
{% assign promoted_site_categories = site.categories | where: "promoted", "true" | sort: "homepage_order" %}

{% for site_category in promoted_site_categories limit:6 %}
{% assign current_category = categories | where:"name", site_category.name | first %}
{% assign category_questions = current_category.items %}
<div class="usa-media-block tablet:grid-col-4 margin-bottom-3">
<h3>{{ site_category.title }}</h3>
<ul class="usa-list usa-list--unstyled">
{% for question in category_questions limit:4 %}
{% if page.lang == question.lang %}
<li class="padding-y-1">
<a href="{{ site.baseurl }}/{{ site_category.name}}/#{{ question.title|slugify }}">{{ question.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<a href="{{ site.baseurl }}/{{ site_category.name}}/" class="text-bold text-underline margin-y-1">View all <span class="usa-sr-only">questions about {{ site_category.title }} </span><span aria-hidden="true">»</span></a>
</div>
{% assign current_category = categories | where:"name", site_category.name | first %}
{% assign category_questions = current_category.items %}
<div class="usa-media-block tablet:grid-col-4 margin-bottom-3">
<h3>{{ site_category.title }}</h3>
<ul class="usa-list usa-list--unstyled">
{% for question in category_questions limit:4 %}
{% if page.lang == question.lang %}
<li class="padding-y-1">
<a href="{{ site.baseurl }}/{{ site_category.name}}/#{{ question.title|slugify }}">{{ question.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<a href="{{ site.baseurl }}/{{ site_category.name}}/" class="text-bold text-underline margin-y-1">View all <span
class="usa-sr-only">questions about {{ site_category.title }} </span><span aria-hidden="true">»</span></a>
</div>
{% endfor %}
</div>
</section>
</section>

0 comments on commit 7c57701

Please sign in to comment.