Ensure decks.yaml is readable as config
- Dominant language
- Python
- Stars
- 146
- Forks
- 97
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 103
Description
The current config: https://github.com/OWASP/cornucopia/blob/master/cornucopia.owasp.org/decks.yaml
should be read in as a config.js file in order to be able to use it from anywhere in svelte.
// src/lib/config.js
import yaml from 'yaml';
import yamlText from '$lib/../../decks.yaml?raw';
// Export the native object structure
export const config = yaml.parse(yamlText);
export const decks = config.decks;
then it can be read in here: https://github.com/OWASP/cornucopia/blob/55730310ff0f238e541040647ffe630e4d42a923/cornucopia.owasp.org/src/lib/services/deckConfigService.ts#L2
like this:
import { deckConfig } from '$lib/config';
or from anywhere in the code where it is needed.
Contributor guide
Assessment
This issue has not been assessed yet.