diff --git a/package.json b/package.json index 83864ba4a..ecfd184f5 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@astrojs/sitemap": "^3.3.0", "@astrojs/tailwind": "^5.1.4", "@fontsource-variable/inter": "^5.1.1", + "@fortawesome/fontawesome-free": "^6.7.2", "@tailwindcss/typography": "^0.5.16", "@types/react": "^19.1.0", "@types/react-dom": "^19.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b9a1447a..15eb290db 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@fontsource-variable/inter': specifier: ^5.1.1 version: 5.2.5 + '@fortawesome/fontawesome-free': + specifier: ^6.7.2 + version: 6.7.2 '@tailwindcss/typography': specifier: ^0.5.16 version: 0.5.16(tailwindcss@3.4.17) @@ -604,6 +607,10 @@ packages: '@fontsource-variable/inter@5.2.5': resolution: {integrity: sha512-TrWffUAFOnT8zroE9YmGybagoOgM/HjRqMQ8k9R0vVgXlnUh/vnpbGPAS/Caz1KIlOPnPGh6fvJbb7DHbFCncA==} + '@fortawesome/fontawesome-free@6.7.2': + resolution: {integrity: sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==} + engines: {node: '>=6'} + '@img/sharp-darwin-arm64@0.33.5': resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} @@ -3498,6 +3505,8 @@ snapshots: '@fontsource-variable/inter@5.2.5': {} + '@fortawesome/fontawesome-free@6.7.2': {} + '@img/sharp-darwin-arm64@0.33.5': optionalDependencies: '@img/sharp-libvips-darwin-arm64': 1.0.4 diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 372114db3..2b48d6061 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -1,8 +1,4 @@ --- -// Import the global.css file here so that it is included on -// all pages through the use of the component. -import "../styles/global.css"; -import "@fontsource-variable/inter"; interface Props { title: string; @@ -58,8 +54,3 @@ const { title, description, image = "/social-card.png" } = Astro.props; is:inline data-domain="ep2025.europython.eu" src="https://plausible.io/js/script.js"> - - diff --git a/src/components/footer.astro b/src/components/Footer.astro similarity index 98% rename from src/components/footer.astro rename to src/components/Footer.astro index 83f15a299..594df4740 100644 --- a/src/components/footer.astro +++ b/src/components/Footer.astro @@ -8,6 +8,7 @@ const buildTimestamp = import.meta.env.TIMESTAMP; const gitVersion = import.meta.env.GIT_VERSION; --- +
+
diff --git a/src/components/header/header.astro b/src/components/Header.astro similarity index 80% rename from src/components/header/header.astro rename to src/components/Header.astro index 2f4d0d4a4..de0d13ed0 100644 --- a/src/components/header/header.astro +++ b/src/components/Header.astro @@ -1,10 +1,10 @@ --- import { promises as fs } from "fs"; -import { NavItems } from "../nav-items"; -import HeaderActions from "./header-actions.astro"; -import HeaderLogo from "./header-logo.astro"; +import { NavItems } from "@components/nav-items"; +import HeaderActions from "@components/header/header-actions.astro"; +import HeaderLogo from "@components/header/header-logo.astro"; -const links = JSON.parse(await fs.readFile("./src/data/links.json", "utf-8")); +import links from "../data/links.json"; ---
@@ -27,7 +27,7 @@ const links = JSON.parse(await fs.readFile("./src/data/links.json", "utf-8")); + + + + diff --git a/src/components/header/header-actions.astro b/src/components/header/header-actions.astro index 60bcfdb9c..0b2407237 100644 --- a/src/components/header/header-actions.astro +++ b/src/components/header/header-actions.astro @@ -1,7 +1,7 @@ --- import Button from "@ui/Button.astro"; import HeaderButton from "./header-button.astro"; -import Search from "astro-pagefind/components/Search"; +import Icon from "@ui/Icon.astro"; export interface Props { mobile?: boolean; @@ -10,148 +10,103 @@ export interface Props { const { mobile = false }: Props = Astro.props; const IS_LIVE = false; + + + // --- -
- +
+
{ - !mobile ? ( + !mobile ? <> - - {IS_LIVE && } + + + + {IS_LIVE && } - ) : null + : null } +
- - diff --git a/src/components/ui/Button.astro b/src/components/ui/Button.astro index 2300cda31..665d35baa 100644 --- a/src/components/ui/Button.astro +++ b/src/components/ui/Button.astro @@ -1,16 +1,22 @@ --- import Icon from "@ui/Icon.astro"; +// Destructure known props, rest goes into `restProps` const { url, + id, class: className = "", secondary = false, outline = false, disabled = false, + clear = false, isExternal, icon, iconSvg = false, - iconRight = true + iconRight = true, + iconSize = "", + title = "", + ...restProps // all data-*, aria-* and custom attributes } = Astro.props; const resolvedIsExternal = isExternal ?? url?.startsWith("http"); @@ -18,38 +24,49 @@ const resolvedIsExternal = isExternal ?? url?.startsWith("http"); const baseClasses = "font-bold text-lg px-4 py-4 rounded-lg inline-flex items-center justify-center leading-4 transition-colors duration-200 not-prose border hover:text-black"; const primaryClasses = "bg-button text-text-inverted hover:bg-button-hover border-transparent"; const secondaryClasses = "bg-primary text-white hover:bg-primary-hover border-transparent"; +const clearClasses = "bg-transparent text-primary hover:bg-transparent hover:text-primary-active border-transparent"; const outlineClasses = "border-gray-500 text-gray-700 hover:bg-gray-100 hover:bg-button-hover"; const disabledClasses = "opacity-50 pointer-events-none"; const iconClasses = "mx-2 "; +const idName = id; +const slotContent = await Astro.slots.render('default'); --- {url ? ( - {!iconRight && icon && } + {!iconRight && icon && } - {iconRight && icon && } - {resolvedIsExternal && } + {iconRight && icon && } + {resolvedIsExternal && } ) : ( )} diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro new file mode 100644 index 000000000..e0777e0e0 --- /dev/null +++ b/src/layouts/BaseLayout.astro @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/layouts/HomePageLayout.astro b/src/layouts/HomePageLayout.astro index c11f772ff..d03256a1b 100644 --- a/src/layouts/HomePageLayout.astro +++ b/src/layouts/HomePageLayout.astro @@ -1,12 +1,5 @@ --- -import Header from "../components/header/header.astro"; -import Footer from "../components/footer.astro"; -import BaseHead from "../components/BaseHead.astro"; - -export interface Props { - title: string; - description: string; -} +import Layout from "@layouts/Layout.astro"; const { title, description } = Astro.props; const jsonLd = JSON.stringify({ @@ -38,24 +31,7 @@ const jsonLd = JSON.stringify({ }); --- - - - - -