Skip to content

Commit 100413f

Browse files
committed
Rename categories collection to dataset_categories
Jekyll comes with a built-in `site.categories` collection, so we're renaming this to avoid conflict, should any JKAN users want to take advantage of the built-in collection.
1 parent 035ec0f commit 100413f

18 files changed

+17
-14
lines changed

_config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ collections:
3030
organizations:
3131
output: true
3232
permalink: /organizations/:path/
33-
categories:
33+
dataset_categories:
3434
output: true
3535
permalink: /categories/:path/
3636

3737
# Collections (cont'd)
3838
defaults:
3939
- scope:
4040
path: ""
41-
type: categories
41+
type: dataset_categories
4242
values:
4343
layout: category
4444
- scope:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

categories.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<a href="{{ site.baseurl }}/add-category/" class="btn btn-outline-secondary float-right admin-only" data-hook="add-category-btn"><i class="fa fa-plus"></i> Add category</a>
99

10-
{% for category in site.categories %}
10+
{% for category in site.dataset_categories %}
1111
{% assign dataset_count = site.datasets | where:"category", category.name | size %}
1212
<div class="media">
1313
<div class="mr-3">

editor/netlify-cms.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ backend:
77
media_folder: "img/uploads"
88

99
collections:
10-
- name: dataset
11-
label: Dataset
10+
- name: datasets
11+
label: Datasets
12+
label_singular: Dataset
1213
folder: _datasets
1314
create: true
1415
summary: "{{title}} ({{organization}})"
@@ -25,7 +26,7 @@ collections:
2526
name: organization
2627
required: false
2728
widget: relation
28-
collection: organization
29+
collection: organizations
2930
value_field: "title"
3031
search_fields:
3132
- title
@@ -75,11 +76,11 @@ collections:
7576
name: category
7677
required: false
7778
widget: relation
79+
collection: categories
7880
multiple: true
79-
collection: settings
80-
file: categories
81-
value_field: "items.*.name"
82-
search_fields: ["items.*.name"]
81+
value_field: "name"
82+
search_fields:
83+
- name
8384

8485
- label: Maintainer
8586
name: maintainer
@@ -91,8 +92,9 @@ collections:
9192
required: false
9293
widget: string
9394

94-
- name: organization
95-
label: Organization
95+
- name: organizations
96+
label: Organizations
97+
label_singular: Organization
9698
folder: _organizations
9799
create: true
98100
preview_path: "organizations/{{slug}}"
@@ -115,7 +117,8 @@ collections:
115117

116118
- name: categories
117119
label: Categories
118-
folder: _categories
120+
label_singular: Category
121+
folder: _dataset_categories
119122
description: Dataset categories
120123
create: true
121124
preview_path: "categories/{{slug}}"

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 class="display-4">{{ site.greeting }}</h1>
1313

1414
<h3>Browse by Category</h3>
1515
<div class="homepage-categories">
16-
{% for category in site.categories %}
16+
{% for category in site.dataset_categories %}
1717
{% if category.featured == true %}
1818
{% capture logo_alt %}{{ category.name }}{% if category.logo_credit and category.logo_credit != empty %} logo by {{ category.logo_credit }}{% endif %}{% endcapture %}
1919
<a href="{{ site.baseurl }}/categories/{{ category.name | slugify }}" class="thumbnail" title="{{ logo_alt }}">

0 commit comments

Comments
 (0)