diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a274ce6..c42b226 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -25,9 +25,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Generate static JSON file with data - run: npm run static-data - - name: Build run: npm run build diff --git a/.gitignore b/.gitignore index 00ea31b..49a4e12 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* -static/data.json +static/config.json +src/lib/config.json \ No newline at end of file diff --git a/src/lib/config.js b/data/config.yaml similarity index 98% rename from src/lib/config.js rename to data/config.yaml index f175fe7..270d0ec 100644 --- a/src/lib/config.js +++ b/data/config.yaml @@ -1,7 +1,3 @@ -import yaml from 'js-yaml'; - -const CONFIG = yaml.load(` - title: Web3Privacy Prague 2023 shortname: "Web3Privacy Summit #1" 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). - 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)). +- title: Why isn't admission free? + text: people: - id: mykola name: Mykola Siusko @@ -129,7 +127,3 @@ program: - time: 20:00 - 4:00 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). - -`); - -export default CONFIG; diff --git a/package.json b/package.json index e97132b..ecde677 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,11 @@ "dev": "vite dev", "build": "vite build", "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 .", - "format": "prettier --plugin-search-dir . --write ." + "format": "prettier --plugin-search-dir . --write .", + "postinstall": "npm run build-config && npm run static-config" }, "devDependencies": { "@sveltejs/adapter-auto": "^2.0.0", diff --git a/src/routes/+layout.js b/src/routes/+layout.js index fe99e8b..9dcee99 100644 --- a/src/routes/+layout.js +++ b/src/routes/+layout.js @@ -1,4 +1,4 @@ -import config from '$lib/config'; +import config from '$lib/config.json'; export async function load({ params, url, fetch }) { return {