Skip to content

Commit 37eb27e

Browse files
authored
Merge branch 'ep2025' into update-beginners-day-landing
2 parents 14b0e20 + 751624d commit 37eb27e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4143
-745
lines changed

.github/workflows/preview.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
BRANCH: "${{ env.GITHUB_BRANCH_NAME }}"
5555
run: make preview
5656

57+
- name: Get safe branch and export to env
58+
env:
59+
BRANCH: ${{ env.GITHUB_BRANCH_NAME }}
60+
run: |
61+
echo "SAFE_BRANCH=$(make safe_branch)" >> $GITHUB_ENV
62+
5763
- name: Update PR Comment
5864
uses: actions/github-script@v7
5965
if: github.event_name == 'pull_request'
@@ -80,8 +86,8 @@ jobs:
8086
}
8187
});
8288
83-
const branch_name = process.env.GITHUB_BRANCH_NAME;
84-
const url = "https://" + branch_name + "." + process.env.PREVIEW_HOSTNAME;
89+
const safe_branch = process.env.SAFE_BRANCH;
90+
const url = "https://" + safe_branch + "." + process.env.PREVIEW_HOSTNAME;
8591
const timestamp = new Date().toISOString();
8692
const header = "\n|Key|Value|\n|---|---|\n"
8793
const body = preview_identifier + header + "|url|" + url + "|\n|last update|" + timestamp + "|";

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export GIT_VERSION ?= $(shell git rev-parse --short HEAD)
1818
# Auto-detect and sanitize current git branch
1919
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
2020
# Replace "/" and other non-alphanumeric characters with "-"
21-
SAFE_BRANCH := $(shell echo "$(BRANCH)" | sed 's/[^A-Za-z0-9-]/-/g')
21+
SAFE_BRANCH := $(shell echo "$(BRANCH)" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g')
2222
FORCE_DEPLOY ?= false
2323
SITE_URL ?= "https://$(SAFE_BRANCH).ep-preview.click"
2424

@@ -44,6 +44,7 @@ check:
4444

4545
build:
4646
pnpm run astro build --mode $(MODE)
47+
pnpm pagefind
4748

4849
preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases
4950
preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP)

astro.config.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import remarkToc from "remark-toc";
66
import rehypeSlug from "rehype-slug";
77
import rehypeAutolinkHeadings from "rehype-autolink-headings";
88
import metaTags from "astro-meta-tags";
9-
import pagefind from "astro-pagefind";
109
import deleteUnusedImages from "astro-delete-unused-images";
10+
import serviceWorker from "astrojs-service-worker";
1111
import { execSync } from "node:child_process";
1212
import svelte from "@astrojs/svelte";
1313
import compress from "astro-compress";
@@ -116,9 +116,11 @@ export default defineConfig({
116116
mdx(),
117117
sitemap(),
118118
metaTags(),
119-
pagefind(),
120119
deleteUnusedImages(),
121120
svelte(),
121+
serviceWorker({
122+
workbox: { inlineWorkboxRuntime: true },
123+
}),
122124
compress({
123125
HTML: false,
124126
CSS: false,
@@ -134,4 +136,8 @@ export default defineConfig({
134136
remotePatterns: [{ protocol: "https" }],
135137
domains: ["programme.europython.eu", "placehold.co"],
136138
},
139+
prefetch: {
140+
prefetchAll: true,
141+
defaultStrategy: "load",
142+
},
137143
});

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "astro dev",
77
"start": "astro dev",
8-
"build": "astro check && astro build && pnpm pagefind --site dist",
8+
"build": "astro check && astro build && pnpm pagefind",
99
"preview": "astro preview",
1010
"astro": "astro",
1111
"format": "prettier --write --plugin=prettier-plugin-astro ."
@@ -20,13 +20,14 @@
2020
"@fortawesome/fontawesome-free": "^6.7.2",
2121
"@nanostores/persistent": "^1.0.0",
2222
"@tailwindcss/typography": "^0.5.16",
23-
"@tailwindcss/vite": "^4.1.7",
23+
"@tailwindcss/vite": "^4.1.8",
2424
"astro": "^5.8.0",
2525
"astro-compress": "^2.3.8",
2626
"astro-delete-unused-images": "^1.0.3",
2727
"astro-meta-tags": "^0.3.2",
2828
"astro-pagefind": "^1.8.3",
2929
"astro-preload": "^1.1.2",
30+
"astrojs-service-worker": "^2.0.0",
3031
"clsx": "^2.1.1",
3132
"date-fns": "^4.1.0",
3233
"date-fns-tz": "^3.2.0",
@@ -39,8 +40,8 @@
3940
"rehype-slug": "^6.0.0",
4041
"remark-toc": "^9.0.0",
4142
"sharp": "^0.34.2",
42-
"svelte": "^5.30.2",
43-
"tailwindcss": "^4.1.7",
43+
"svelte": "^5.33.12",
44+
"tailwindcss": "^4.1.8",
4445
"typescript": "^5.8.3"
4546
},
4647
"devDependencies": {

pagefind.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
site: dist
22
glob: "**/*.{html}"
3+
root_selector: "main"

0 commit comments

Comments
 (0)