Skip to content

Commit 8e763d9

Browse files
committed
Generate sessions and speakers from json files.
1 parent 0aceaf0 commit 8e763d9

27 files changed

+570
-177
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ dmypy.json
128128
.pyre/
129129

130130
.vscode/
131+
.idea/
131132
out/
132133
.next/
133134
.DS_Store
@@ -138,3 +139,11 @@ storybook-static/
138139
# Sentry Auth Token
139140
.sentryclirc
140141
.astro
142+
143+
# EuroPython website
144+
src/content/speakers
145+
src/content/sessions
146+
src/content/days
147+
src/data/speakers.json
148+
src/data/sessions.json
149+
src/data/schedule.json

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
1919
# Replace "/" and other non-alphanumeric characters with "-"
2020
SAFE_BRANCH := $(shell echo "$(BRANCH)" | sed 's/[^A-Za-z0-9-]/-/g')
2121
FORCE_DEPLOY ?= false
22+
SITE_URL ?= "https://$(SAFE_BRANCH).ep-preview.click"
2223

2324
.PHONY: build deploy dev clean install
2425

25-
2626
safe_branch:
2727
@echo $(SAFE_BRANCH)
2828

@@ -31,6 +31,8 @@ pre:
3131

3232
install:
3333
pnpm install
34+
pnpm update_data
35+
pnpm generate_content
3436

3537
dev:
3638
pnpm dev
@@ -47,6 +49,7 @@ build:
4749
preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases
4850
preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP)
4951
preview:
52+
@echo "Preview site URL: $(SITE_URL)" # Output preview URL
5053
echo $(TARGET)
5154
@echo "\n\n**** Deploying preview of a branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n"
5255
$(REMOTE_CMD) "mkdir -p $(TARGET)"

astro.config.mjs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import path, { dirname } from "path";
2-
import { fileURLToPath } from "url";
1+
import path from "path";
32
import { defineConfig } from "astro/config";
43
import mdx from "@astrojs/mdx";
5-
import { h } from "hastscript";
64
import sitemap from "@astrojs/sitemap";
75
import react from "@astrojs/react";
86
import tailwind from "@astrojs/tailwind";
@@ -13,9 +11,6 @@ import metaTags from "astro-meta-tags";
1311
import pagefind from "astro-pagefind";
1412
import deleteUnusedImages from "astro-delete-unused-images";
1513

16-
const __filename = fileURLToPath(import.meta.url);
17-
const __dirname = dirname(__filename); // @type-check enabled!
18-
1914
// https://astro.build/config
2015
export default defineConfig({
2116
vite: {
@@ -24,6 +19,7 @@ export default defineConfig({
2419
},
2520
resolve: {
2621
alias: {
22+
"@data": path.resolve("./src/data"),
2723
"@components": path.resolve("./src/components"),
2824
"@sections": path.resolve("./src/components/sections"),
2925
"@layouts": path.resolve("./src/layouts"),
@@ -63,7 +59,6 @@ export default defineConfig({
6359
"/sponsor/": "/sponsorship/sponsor/",
6460
"/voting/": "/programme/voting/",
6561
"/wasm-summit/": "/programme/wasm-summit/",
66-
"/sessions/": "/programme/sessions/",
6762
},
6863
integrations: [
6964
mdx(),
@@ -80,4 +75,11 @@ export default defineConfig({
8075
build: {
8176
minify: true,
8277
},
78+
image: {
79+
experimentalLayout: "responsive",
80+
},
81+
experimental: {
82+
responsiveImages: true,
83+
svg: true,
84+
},
8385
});

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"scripts": {
66
"dev": "astro dev",
77
"start": "astro dev",
8-
"build": "astro check && astro build && pnpm pagefind --site dist",
8+
"build": "pnpm generate_content && astro check && astro build && pnpm pagefind --site dist",
9+
"update_data": "NODE_TLS_REJECT_UNAUTHORIZED=0 node src/scripts/fetchData.js",
10+
"generate_content": "node src/scripts/generateContent.js",
911
"preview": "astro preview",
1012
"astro": "astro",
1113
"format": "prettier --write --plugin=prettier-plugin-astro ."
@@ -29,6 +31,8 @@
2931
"date-fns": "^4.1.0",
3032
"date-fns-tz": "^3.2.0",
3133
"hastscript": "^9.0.0",
34+
"js-yaml": "^4.1.0",
35+
"marked": "^15.0.7",
3236
"pagefind": "^1.3.0",
3337
"react": "^19.1.0",
3438
"react-dom": "^19.1.0",
@@ -40,6 +44,7 @@
4044
"typescript": "^5.8.3"
4145
},
4246
"devDependencies": {
47+
"@types/js-yaml": "^4.0.9",
4348
"prettier": "^3.4.2",
4449
"prettier-plugin-astro": "^0.14.1"
4550
},

pnpm-lock.yaml

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/favicon.ico

56.6 KB
Binary file not shown.

scripts/download-data.py

Lines changed: 0 additions & 79 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)