Skip to content

Commit ac7dbb3

Browse files
Merge branch 'ep2025' into ep2025-overview
2 parents ce41edd + 553b11a commit ac7dbb3

25 files changed

+936
-369
lines changed

.github/workflows/preview.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,21 @@ jobs:
3232
- name: Install dependencies
3333
run: make install
3434

35+
- name: Get current branch name
36+
run: |
37+
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
38+
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
39+
3540
- name: Build the website
36-
run: make build PREVIEW=true
41+
run:
42+
make build PREVIEW=true
43+
SITE_URL="https://${BRANCH_NAME}.ep-preview.click"
3744

3845
- name: Set up SSH key
3946
uses: webfactory/[email protected]
4047
with:
4148
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
4249

43-
- name: Get current branch name
44-
run: |
45-
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
46-
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
47-
4850
- name: ssh keyscan
4951
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
5052

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ build:
2020
commands:
2121
- npm install -g pnpm@latest-10
2222
- make install
23-
- make build PREVIEW=true
23+
- make build PREVIEW=true SITE_URL=$READTHEDOCS_CANONICAL_URL
2424
- mkdir -p $READTHEDOCS_OUTPUT/html
2525
- cd dist && cp -r * $READTHEDOCS_OUTPUT/html

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ VPS_HOST ?= static.europython.eu
66
VPS_PROD_PATH ?= /home/static_content_user/content/europython_websites/ep2025
77
VPS_PREVIEW_PATH ?= /home/static_content_user/content/previews
88
REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST)
9+
PREVIEW_SITE_URL ?= "https://$(SAFE_BRANCH).ep-preview.click"
910

1011
# Variables for build/deploy
1112
# ==========================
@@ -47,13 +48,14 @@ build:
4748
preview: RELEASES_DIR = $(VPS_PREVIEW_PATH)/$(SAFE_BRANCH)/releases
4849
preview: TARGET = $(RELEASES_DIR)/$(TIMESTAMP)
4950
preview:
50-
@echo "Preview site URL: $(SITE_URL)" # Output preview URL
51+
@echo "Preview site URL: $(PREVIEW_SITE_URL)"
5152
echo $(TARGET)
5253
@echo "\n\n**** Deploying preview of a branch '$(BRANCH)' (safe: $(SAFE_BRANCH)) to $(TARGET)...\n\n"
5354
$(REMOTE_CMD) "mkdir -p $(TARGET)"
5455
rsync -avz --delete ./dist/ $(VPS_USER)@$(VPS_HOST):$(TARGET)/
5556
$(REMOTE_CMD) "cd $(RELEASES_DIR) && ln -snf $(TIMESTAMP) current"
5657
@echo "\n\n**** Preview complete.\n\n"
58+
@echo "Open the preview site at: $(PREVIEW_SITE_URL)\n\n"
5759

5860

5961
ifeq ($(FORCE_DEPLOY), true)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@astrojs/sitemap": "^3.3.0",
1919
"@astrojs/tailwind": "^5.1.4",
2020
"@fontsource-variable/inter": "^5.1.1",
21+
"@fortawesome/fontawesome-free": "^6.7.2",
2122
"@tailwindcss/typography": "^0.5.16",
2223
"@types/react": "^19.1.0",
2324
"@types/react-dom": "^19.1.1",

pnpm-lock.yaml

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

src/components/BaseHead.astro

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
---
2-
// Import the global.css file here so that it is included on
3-
// all pages through the use of the <BaseHead /> component.
4-
import "../styles/global.css";
5-
import "@fontsource-variable/inter";
62
73
interface Props {
84
title: string;
@@ -58,8 +54,3 @@ const { title, description, image = "/social-card.png" } = Astro.props;
5854
is:inline
5955
data-domain="ep2025.europython.eu"
6056
src="https://plausible.io/js/script.js"></script>
61-
62-
<script
63-
is:inline
64-
src="https://kit.fontawesome.com/14a4971ab3.js"
65-
crossorigin="anonymous"></script>

src/components/footer.astro renamed to src/components/Footer.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const buildTimestamp = import.meta.env.TIMESTAMP;
88
const gitVersion = import.meta.env.GIT_VERSION;
99
---
1010

11+
<div class="mt-auto">
1112
<Fullbleed className="bg-primary text-white">
1213
<footer
1314
class="max-w-4xl lg:max-w-6xl mx-auto py-16 lg:grid grid-cols-2 px-6 gap-60"
@@ -106,3 +107,4 @@ const gitVersion = import.meta.env.GIT_VERSION;
106107
</article>
107108
</footer>
108109
</Fullbleed>
110+
</div>

src/components/header/header.astro renamed to src/components/Header.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
import { promises as fs } from "fs";
3-
import { NavItems } from "../nav-items";
4-
import HeaderActions from "./header-actions.astro";
5-
import HeaderLogo from "./header-logo.astro";
3+
import { NavItems } from "@components/nav-items";
4+
import HeaderActions from "@components/header/header-actions.astro";
5+
import HeaderLogo from "@components/header/header-logo.astro";
66
7-
const links = JSON.parse(await fs.readFile("./src/data/links.json", "utf-8"));
7+
import links from "../data/links.json";
88
---
99

1010
<header class="p-6 flex items-center justify-between relative z-40">
@@ -27,7 +27,7 @@ const links = JSON.parse(await fs.readFile("./src/data/links.json", "utf-8"));
2727
<div
2828
class="fixed bg-body-background top-0 left-0 w-screen h-screen overflow-scroll hidden peer-checked:block xl:peer-checked:hidden z-50 p-6"
2929
>
30-
<div class="flex items-center">
30+
<div class="flex items-center justify-between">
3131
<HeaderLogo />
3232
<HeaderActions mobile />
3333
</div>

src/components/Modal.astro

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
import Button from '@ui/Button.astro';
3+
const { id = 'modal', open = false, closeOnOutsideClick = false } = Astro.props;
4+
---
5+
<div
6+
id={id}
7+
class={`fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${
8+
open ? 'opacity-100 visible bg-black/50' : 'opacity-0 invisible'
9+
}`}
10+
data-modal-wrapper
11+
data-close-on-outside-click={closeOnOutsideClick.toString()}
12+
>
13+
<div
14+
class="relative bg-white dark:bg-gray-800 p-6 lg:rounded-2xl lg:shadow-xl lg:max-w-4xl lg:mx-4 h-full lg:h-[80vh] w-full lg:w-[70vw] max-h-full overflow-y-auto"
15+
data-modal-content
16+
>
17+
<Button
18+
id="search-close"
19+
clear
20+
icon="close"
21+
iconSize="fa-xl"
22+
data-close-modal
23+
class="w-[3em] h-[3em] absolute top-4 right-4 text-primary hover:text-black "
24+
/>
25+
<slot />
26+
</div>
27+
</div>
28+
<script is:inline>
29+
document.addEventListener('DOMContentLoaded', () => {
30+
// Function to toggle body scroll
31+
const toggleBodyScroll = (disable) => {
32+
if (disable) {
33+
// Save the current scroll position
34+
const scrollY = window.scrollY;
35+
document.body.style.position = 'fixed';
36+
document.body.style.top = `-${scrollY}px`;
37+
document.body.style.width = '100%';
38+
document.body.dataset.scrollPosition = scrollY.toString();
39+
} else {
40+
// Restore scroll position
41+
const scrollY = parseInt(document.body.dataset.scrollPosition || '0');
42+
document.body.style.position = '';
43+
document.body.style.top = '';
44+
document.body.style.width = '';
45+
window.scrollTo(0, scrollY);
46+
delete document.body.dataset.scrollPosition;
47+
}
48+
};
49+
50+
// Function to open modal
51+
const openModal = (modal) => {
52+
if (modal) {
53+
// Disable body scroll
54+
toggleBodyScroll(true);
55+
// Show modal
56+
modal.classList.remove('opacity-0', 'invisible');
57+
modal.classList.add('opacity-100', 'visible');
58+
}
59+
};
60+
61+
// Function to close modal
62+
const closeModal = (modal) => {
63+
if (modal) {
64+
// Enable body scroll
65+
toggleBodyScroll(false);
66+
// Hide modal
67+
modal.classList.remove('opacity-100', 'visible');
68+
modal.classList.add('opacity-0', 'invisible');
69+
}
70+
};
71+
72+
// Open modal buttons
73+
document.querySelectorAll('[data-open-modal]').forEach(button => {
74+
button.addEventListener('click', () => {
75+
const modal = document.getElementById(button.dataset.openModal);
76+
openModal(modal);
77+
});
78+
});
79+
80+
// Close modal buttons
81+
document.querySelectorAll('[data-close-modal]').forEach(button => {
82+
button.addEventListener('click', () => {
83+
const modal = button.closest('[data-modal-wrapper]');
84+
closeModal(modal);
85+
});
86+
});
87+
88+
// Close when clicking outside the modal content - only if enabled
89+
document.querySelectorAll('[data-modal-wrapper]').forEach(modal => {
90+
const closeOnOutsideClick = modal.dataset.closeOnOutsideClick === 'true';
91+
92+
if (closeOnOutsideClick) {
93+
modal.addEventListener('click', (event) => {
94+
// Check if the click was on the wrapper but not on the content
95+
if (event.target === modal) {
96+
closeModal(modal);
97+
}
98+
});
99+
}
100+
101+
// Initialize any modal that's set to open by default
102+
if (modal.classList.contains('opacity-100') && modal.classList.contains('visible')) {
103+
toggleBodyScroll(true);
104+
}
105+
});
106+
107+
// Handle escape key to close all modals
108+
document.addEventListener('keydown', (event) => {
109+
if (event.key === 'Escape') {
110+
const visibleModals = document.querySelectorAll('[data-modal-wrapper].visible, [data-modal-wrapper].opacity-100');
111+
visibleModals.forEach(modal => closeModal(modal));
112+
}
113+
});
114+
});
115+
</script>

0 commit comments

Comments
 (0)