Skip to content

Commit a190cf4

Browse files
authored
Merge branch 'ep2025' into tickets-page-registration-open
2 parents 0e1aa0e + 368b8bc commit a190cf4

File tree

12 files changed

+258
-27
lines changed

12 files changed

+258
-27
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ check:
4242
pnpm run astro check
4343

4444
build:
45-
# TODO: update this to just `pnpm build` after resolving the astro-check warnings
46-
pnpm run astro build
45+
pnpm build
4746
# NOTE: also let's find a better way to do this :D
4847
find ./dist/_astro/ -iname '*.jpg' -delete
4948

astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import remarkToc from "remark-toc";
88
import rehypeSlug from "rehype-slug";
99
import rehypeAutolinkHeadings from "rehype-autolink-headings";
1010
import metaTags from "astro-meta-tags";
11+
import pagefind from "astro-pagefind";
1112

1213
// https://astro.build/config
1314
export default defineConfig({
@@ -42,6 +43,7 @@ export default defineConfig({
4243
nesting: true,
4344
}),
4445
metaTags(),
46+
pagefind(),
4547
],
4648
output: "static",
4749
});

package.json

Lines changed: 3 additions & 1 deletion
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",
8+
"build": "astro check && astro build && pnpm pagefind --site dist",
99
"preview": "astro preview",
1010
"astro": "astro",
1111
"format": "prettier --write --plugin=prettier-plugin-astro ."
@@ -23,10 +23,12 @@
2323
"@types/react-dom": "^19.0.4",
2424
"astro": "^5.1.6",
2525
"astro-meta-tags": "^0.3.1",
26+
"astro-pagefind": "^1.8.1",
2627
"clsx": "^2.1.1",
2728
"date-fns": "^4.1.0",
2829
"date-fns-tz": "^3.2.0",
2930
"hastscript": "^9.0.0",
31+
"pagefind": "^1.3.0",
3032
"react": "^19.0.0",
3133
"react-dom": "^19.0.0",
3234
"rehype-autolink-headings": "^7.1.0",

pagefind.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
site: dist
2+
glob: "**/*.{html}"

pnpm-lock.yaml

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

src/components/header/header-actions.astro

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import ButtonLink from "../button-link/button-link.astro";
33
import HeaderButton from "./header-button.astro";
4+
import Search from "astro-pagefind/components/Search";
45
56
export interface Props {
67
mobile?: boolean;
@@ -12,6 +13,13 @@ const IS_LIVE = false;
1213
---
1314

1415
<div class="ml-auto flex items-center space-x-4">
16+
<Search id="search" className="pagefind-ui" uiOptions={{
17+
18+
showImages: false,
19+
translations: {
20+
zero_results: "Couldn't find [SEARCH_TERM]"
21+
}
22+
}} />
1523
{
1624
!mobile ? (
1725
<>
@@ -34,3 +42,119 @@ const IS_LIVE = false;
3442
</HeaderButton>
3543
</label>
3644
</div>
45+
<script>
46+
document.addEventListener("DOMContentLoaded", function () {
47+
const searchContainer = document.querySelector(".pagefind-ui");
48+
const searchInput = searchContainer?.querySelector("input");
49+
let selectedIndex = -1;
50+
51+
function updateSelection() {
52+
const results = searchContainer?.querySelectorAll(".pagefind-ui__result");
53+
if (!results) return;
54+
55+
results.forEach((result, index) => {
56+
if (index === selectedIndex) {
57+
result.classList.add("selected");
58+
result.scrollIntoView({ block: "nearest", behavior: "smooth" });
59+
} else {
60+
result.classList.remove("selected");
61+
}
62+
});
63+
}
64+
65+
document.addEventListener("keydown", function (event) {
66+
if (!searchContainer || !searchInput) return;
67+
68+
const results = searchContainer.querySelectorAll(".pagefind-ui__result");
69+
if (document.activeElement === searchInput) {
70+
if (event.key === "ArrowDown") {
71+
event.preventDefault();
72+
selectedIndex = (selectedIndex + 1) % results.length;
73+
updateSelection();
74+
} else if (event.key === "ArrowUp") {
75+
event.preventDefault();
76+
selectedIndex = (selectedIndex - 1 + results.length) % results.length;
77+
updateSelection();
78+
} else if (event.key === "Enter" && selectedIndex >= 0) {
79+
event.preventDefault();
80+
results[selectedIndex].querySelector("a")?.click();
81+
}
82+
}
83+
});
84+
85+
// Reset selection when the search query changes
86+
searchInput?.addEventListener("input", function () {
87+
selectedIndex = -1;
88+
});
89+
90+
});
91+
</script>
92+
<style is:global>
93+
.pagefind-ui__result.selected {
94+
background-color: #f5f5f5;
95+
background-image: linear-gradient(to right, #3684B6 7px, transparent 5px);
96+
-webkit-transform: translate3d(0, 0, 0);
97+
transform: translate3d(0, 0, 0);
98+
}
99+
.pagefind-ui__drawer {
100+
}
101+
.pagefind-ui__message {
102+
margin: 1em;
103+
}
104+
.pagefind-ui__result mark {
105+
background: #F9EB5D;
106+
background-image: linear-gradient(to right, #F9EB5D 10%, #FCF4A7 100%);
107+
margin: 4px;
108+
padding-right: 6px;
109+
padding-left: 6px;
110+
padding-top: 2px;
111+
padding-bottom: 2px;
112+
color: #000000;
113+
font-family: monospace;
114+
border-radius: 4px;
115+
}
116+
.pagefind-ui {
117+
--pagefind-ui-scale: 1;
118+
--pagefind-ui-primary: #141f36;
119+
--pagefind-ui-text: black;
120+
--pagefind-ui-border: #d8d8d8;
121+
--pagefind-ui-border-width: 2px;
122+
--pagefind-ui-border-radius: 0;
123+
width: 50%;
124+
}
125+
.pagefind-ui.yellow {
126+
--pagefind-ui-background: #efc302;
127+
}
128+
.pagefind-ui.red {
129+
--pagefind-ui-background: #ffb9bb;
130+
width: 50%;
131+
}
132+
.pagefind-ui .pagefind-ui__drawer:not(.pagefind-ui__hidden) {
133+
position: absolute;
134+
left: auto;
135+
right: 0;
136+
margin-top: 0px;
137+
width:50vw;
138+
z-index: 9999;
139+
overflow-y: auto;
140+
box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1);
141+
border-bottom-right-radius: var(--pagefind-ui-border-radius);
142+
border-bottom-left-radius: var(--pagefind-ui-border-radius);
143+
background-color: var(--pagefind-ui-background);
144+
}
145+
.pagefind-ui__result{
146+
padding: 0 2em 1em !important;
147+
}
148+
.pagefind-ui .pagefind-ui__result-link {
149+
color: var(--pagefind-ui-primary);
150+
}
151+
.pagefind-ui .pagefind-ui__result-excerpt {
152+
color: var(--pagefind-ui-text);
153+
}
154+
@media (max-width: 1280px) {
155+
.pagefind-ui {
156+
display:none;
157+
}
158+
}
159+
160+
</style>

src/components/keynoters/keynoters.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const placeholders = Math.max(0, 6 - keynoters.length);
102102
{
103103
new Array(placeholders)
104104
.fill(null)
105-
.map((_, index) => (
105+
.map((_, _index) => (
106106
<Keynoter
107107
name=""
108108
slug=""

src/components/logo/logo.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ts-nocheck
12
// TODO: LogoInverted needs to be adapted to the new logo
23
const LogoInverted = ({ className }: { className?: string }) => {
34
return (

0 commit comments

Comments
 (0)