Move data to separate yaml

This commit is contained in:
tree🌴 2023-02-13 19:28:13 +01:00
parent 632f6b975f
commit 4f6beea2c9
5 changed files with 9 additions and 15 deletions

View file

@ -25,9 +25,6 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Generate static JSON file with data
run: npm run static-data
- name: Build - name: Build
run: npm run build run: npm run build

3
.gitignore vendored
View file

@ -8,4 +8,5 @@ node_modules
!.env.example !.env.example
vite.config.js.timestamp-* vite.config.js.timestamp-*
vite.config.ts.timestamp-* vite.config.ts.timestamp-*
static/data.json static/config.json
src/lib/config.json

View file

@ -1,7 +1,3 @@
import yaml from 'js-yaml';
const CONFIG = yaml.load(`
title: Web3Privacy Prague 2023 title: Web3Privacy Prague 2023
shortname: "Web3Privacy Summit #1" shortname: "Web3Privacy Summit #1"
date: Monday, 5. June 2023 date: Monday, 5. June 2023
@ -75,6 +71,8 @@ faq:
text: Yes, we do! We offer discounts (up to 75%) for independent developers, students and especially active privacy advocates or open-source contributors to private protocols or tools. If you are interested in a discount, please fill out [this form](https://tally.so/r/mYPDJW). text: Yes, we do! We offer discounts (up to 75%) for independent developers, students and especially active privacy advocates or open-source contributors to private protocols or tools. If you are interested in a discount, please fill out [this form](https://tally.so/r/mYPDJW).
- title: How do I get to the venue? - title: How do I get to the venue?
text: Venue X10 (full name "[Divadlo X10](https://divadlox10.cz)") is located in the centre of Prague near the metro station *Národní Třída* (Line B) and *Můstek* (Line A,C). The address is [Charvátova 10/39, Prague 1, 110 00](https://goo.gl/maps/Yh8qWagnqB1DvK676) ([Google Maps](https://goo.gl/maps/Yh8qWagnqB1DvK676)). text: Venue X10 (full name "[Divadlo X10](https://divadlox10.cz)") is located in the centre of Prague near the metro station *Národní Třída* (Line B) and *Můstek* (Line A,C). The address is [Charvátova 10/39, Prague 1, 110 00](https://goo.gl/maps/Yh8qWagnqB1DvK676) ([Google Maps](https://goo.gl/maps/Yh8qWagnqB1DvK676)).
- title: Why isn't admission free?
text:
people: people:
- id: mykola - id: mykola
name: Mykola Siusko name: Mykola Siusko
@ -129,7 +127,3 @@ program:
- time: 20:00 - 4:00 - time: 20:00 - 4:00
title: "#Lunarpunk party" title: "#Lunarpunk party"
desc: Enjoy our afterparty in Lunarpunk style with quality Prague rave DJs, which will take place in the same venue until the morning (4am). desc: Enjoy our afterparty in Lunarpunk style with quality Prague rave DJs, which will take place in the same venue until the morning (4am).
`);
export default CONFIG;

View file

@ -6,9 +6,11 @@
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"static-data": "node -e \"(async function () { const data=await import('./src/lib/config.js');console.log(JSON.stringify(data.default, null, 2)); })()\" > static/data.json", "build-config": "js-yaml data/config.yaml > src/lib/config.json",
"static-config": "cp src/lib/config.json static/config.json",
"lint": "prettier --plugin-search-dir . --check . && eslint .", "lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ." "format": "prettier --plugin-search-dir . --write .",
"postinstall": "npm run build-config && npm run static-config"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.0.0",

View file

@ -1,4 +1,4 @@
import config from '$lib/config'; import config from '$lib/config.json';
export async function load({ params, url, fetch }) { export async function load({ params, url, fetch }) {
return { return {