Skip to content

Commit

Permalink
Update to support Netlify CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
hursey013 committed Apr 16, 2020
1 parent e6f162e commit 05929b4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
37 changes: 19 additions & 18 deletions _data/homepage_order.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
- symptoms-and-testing
- spread
- travel
- keeping-home-safe
- financial-help
- parents-and-children
- pregnancy
- support-for-business
- community-events
- k12-childcare
- water-transmission
- rumors
- protect-yourself
- underlying-conditions
- retirement-communities
- animals
- basics
- funerals
categories:
- name: symptoms-and-testing
- name: spread
- name: travel
- name: keeping-home-safe
- name: financial-help
- name: parents-and-children
- name: pregnancy
- name: support-for-business
- name: community-events
- name: k12-childcare
- name: ater-transmission
- name: rumors
- name: protect-yourself
- name: underlying-conditions
- name: retirement-communities
- name: animals
- name: basics
- name: funerals
4 changes: 2 additions & 2 deletions _includes/content-questions.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% assign categories = site.content | group_by:"category" %}
{% assign display_categories = '' | split: '' %}

{% for category in site.data.homepage_order %}
{% assign sorted_category = site.categories | where:"name", category %}
{% for category in site.data.homepage_order.categories %}
{% assign sorted_category = site.categories | where:"name", category.name %}
{% assign display_categories = display_categories | push: sorted_category[0] %}
{% endfor %}

Expand Down
9 changes: 9 additions & 0 deletions admin/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ collections:
- {label: 'Question', name: 'question', widget: 'string'}
- {label: 'Link to answer', name: 'link', widget: 'string'}
- {label: 'View all link', name: 'view_all_link', widget: 'string'}
- label: 'Sorted categories on homepage'
name: "homepage_order"
file: "_data/homepage_order.yml"
fields:
- label: "Categories"
name: "categories"
widget: "list"
fields:
- {label: 'Category name', name: 'name', widget: 'string'}
- label: Categories
name: categories
folder: _categories/
Expand Down

0 comments on commit 05929b4

Please sign in to comment.