Skip to content

Commit c2195ec

Browse files
committed
Add taxonomies related documentation
1 parent dc2c1fb commit c2195ec

5 files changed

Lines changed: 117 additions & 1 deletion

File tree

docs/CONFIGURATION.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ datasets: './datasets/*.data.mdx'
1717
discoveries: './discoveries/*.discoveries.mdx'
1818
```
1919

20+
### Taxonomy Index file
21+
22+
Links to a `json` or `yml` file containing a list of [taxonomies](./TAXONOMY.md) to be used in the app.
23+
24+
The default configuration is:
25+
```js
26+
taxonomiesIndex: './taxonomies.yml',
27+
```
28+
2029
### Page overrides
2130
To adapt the Veda dashboard to the individual needs of you instance, some content/component overrides are provided. These overrides allow you to alter certain parts of the application, or inject code without having to fork the UI part of veda.
2231

docs/CONTENT.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ description: string
4848
media: Media
4949

5050
thematics: string[]
51+
sources: string[]
5152
featured: boolean
5253

5354
layers: Layer[]
@@ -90,14 +91,25 @@ Image to identify this resource. See [media.md](./frontmatter/media.md).
9091

9192
**thematics**
9293
`string[]`
93-
List of thematic areas this dataset belongs to.
94+
List of thematic areas this dataset belongs to.
95+
Must be a list of ids as defined in the [taxonomies index file](./TAXONOMY.md).
9496
Example:
9597
```yaml
9698
thematics:
9799
- covid-19
98100
- agriculture
99101
```
100102
103+
**sources**
104+
`string[]`
105+
List of sources for this dataset.
106+
Must be a list of ids as defined in the [taxonomies index file](./TAXONOMY.md).
107+
Example:
108+
```yaml
109+
sources:
110+
- devseed
111+
```
112+
101113
**featured**
102114
`boolean`
103115
Whether this dataset is featured
@@ -175,6 +187,7 @@ media: Media
175187
pubDate: string
176188
177189
thematics: string[]
190+
sources: string[]
178191
featured: boolean
179192
180193
related: Related[]
@@ -217,13 +230,24 @@ Publication date for this discovery. Should be in YYYY-MM-DD format.
217230
**thematics**
218231
`string[]`
219232
List of thematic areas this discovery belongs to.
233+
Must be a list of ids as defined in the [taxonomies index file](./TAXONOMY.md).
220234
Example:
221235
```yaml
222236
thematics:
223237
- covid-19
224238
- agriculture
225239
```
226240

241+
**sources**
242+
`string[]`
243+
List of sources for this dataset.
244+
Must be a list of ids as defined in the [taxonomies index file](./TAXONOMY.md).
245+
Example:
246+
```yaml
247+
sources:
248+
- devseed
249+
```
250+
227251
**featured**
228252
`boolean`
229253
Whether this discovery is featured

docs/TAXONOMY.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Content
2+
3+
- [Content](#content)
4+
- [Taxonomy Index file](#taxonomy-index-file)
5+
- [Using a taxonomy in a content type](#using-a-taxonomy-in-a-content-type)
6+
7+
Some of veda content types properties are taxonomies.
8+
These are identified by their id and linked to the full taxonomy definition on the taxonomy index file.
9+
10+
## Taxonomy Index file
11+
12+
The location of the taxonomy index file is defined through `veda.config.js` and can either be a `json` or `yml` file.
13+
14+
The different taxonomies are defined as a id keyed list. Each taxonomy item must, at least, have an `id` and `name` properties.
15+
16+
Example:
17+
```yml
18+
# Key of the taxonomy is thematics.
19+
thematics:
20+
- id: water
21+
name: Water Quality
22+
- id: air
23+
name: Air Quality
24+
25+
# Key of the taxonomy is sources.
26+
sources:
27+
- id: devseed
28+
name: Development Seed
29+
url: https://developmentseed.org
30+
```
31+
32+
## Using a taxonomy in a content type
33+
34+
To link a content type to a taxonomy, you need to list the different item's `id` under the taxonomy key on your content type.
35+
36+
Example adding `sources` to a dataset:
37+
```yaml
38+
---
39+
id: my-data
40+
name: My example dataset
41+
description: A dataset with sources
42+
43+
sources:
44+
- devseed
45+
- another-source
46+
47+
layers: # ...
48+
---
49+
50+
<Block>
51+
<Prose>
52+
## This is a Dataset
53+
54+
Once upon a time there was a content string
55+
</Prose>
56+
</Block>
57+
```
58+
59+
If you want to use a taxonomy item that doesn't exist (e.g. a new source) you will need to add it to the taxonomy index file.

taxonomies.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
thematics:
2+
- id: eis
3+
name: EIS
4+
- id: air-quality
5+
name: Air Quality
6+
- id: water-quality
7+
name: Water Quality
8+
- id: environmental-justice
9+
name: Environmental Justice
10+
- id: covid-19
11+
name: Covid 19
12+
- id: agriculture
13+
name: Agriculture
14+
- id: biomass
15+
name: Biomass
16+
17+
# sources:
18+
# - id: eis
19+
# name: EIS

veda.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ module.exports = {
99
*/
1010
discoveries: './discoveries/*.discoveries.mdx',
1111

12+
/**
13+
* File path for the taxonomy index file.
14+
*/
15+
taxonomiesIndex: './taxonomies.yml',
16+
1217
// App component and content overrides.
1318
// See docs/CONFIGURATION.md for more information.
1419
pageOverrides: {

0 commit comments

Comments
 (0)