Skip to content

Commit cbef1f7

Browse files
committed
Styling unification for homepage sections.
1 parent 3f4ef19 commit cbef1f7

File tree

11 files changed

+73
-49
lines changed

11 files changed

+73
-49
lines changed

astro.config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ export default defineConfig({
2424
},
2525
resolve: {
2626
alias: {
27-
$: path.resolve(__dirname, "./src"),
27+
"@components": path.resolve("./src/components"),
28+
"@sections": path.resolve("./src/components/sections"),
29+
"@layouts": path.resolve("./src/layouts"),
30+
"@ui": path.resolve("./src/components/ui"),
31+
"@assets": path.resolve("./src/assets"),
32+
"@i18n": path.resolve("./src/i18n"),
33+
"@src": path.resolve("./src"),
2834
},
2935
},
3036
},

src/components/card/card.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ const { title, subtitle, url, image } = Astro.props;
1717
class="block min-w-[250px] w-full md:w-[40%] lg:w-[30%] p-4 bg-[#D5D6E6] rounded-2xl text-center flex flex-col"
1818
>
1919
<a href={url} class="block">
20-
<div class="relative w-full mb-4">
20+
<div class="relative w-full">
2121
<Image
2222
src={image}
2323
width={600}
2424
height={375}
2525
alt=""
26-
class="rounded-xl aspect-[3/2] w-full"
26+
class="not-prose rounded-xl aspect-[3/2] w-full"
2727
loading="lazy"
2828
/>
2929
</div>
3030
</a>
3131
<div class="flex items-center flex-col flex-grow mb-2">
3232
<a href={url} class="block hover:underline">
33-
<h3 class="text-2xl text-primary">{title}</h3>
33+
<h3 >{title}</h3>
3434
</a>
3535
<slot />
3636
</div>

src/components/keynoters/keynoters.astro

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import ButtonLink from "../button-link/button-link.astro";
3-
import { Title } from "../typography/title";
43
import Keynoter from "./keynoter.astro";
4+
import Headline from "@ui/Headline.astro"
55
66
import { getCollection } from "astro:content";
77
@@ -10,7 +10,7 @@ const keynoters = await getCollection("keynoters");
1010
const placeholders = Math.max(0, 6 - keynoters.length);
1111
---
1212

13-
<section class="relative my-12 px-6">
13+
<section class="prose-xl relative my-12 px-6">
1414
<svg viewBox="0 0 729 704" class="absolute top-0 left-0 w-full h-full -z-10">
1515
<g
1616
stroke="none"
@@ -79,9 +79,7 @@ const placeholders = Math.max(0, 6 - keynoters.length);
7979
</g>
8080
</svg>
8181

82-
<Title className="text-primary">
83-
<a href="/keynoters">Keynote Speakers</a>
84-
</Title>
82+
<Headline id="keynoters" title="Keynote Speakers" />
8583

8684
<ul class="mt-12 mb-24 flex gap-6 flex-wrap">
8785
{
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
import Prague from "@components/hero-section/prague.astro";
3+
import * as venue from "../../data/home/prague.mdx";
4+
---
5+
<div class="mt-2 px-6 pb-40 overflow-visible">
6+
<Prague title={venue.frontmatter.title}>
7+
<venue.Content />
8+
</Prague>
9+
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
3+
import { CardContainer } from "@components/card/card-container";
4+
import { Title } from "@components/typography/title";
5+
import DeadlineCard from "@components/deadline-card.astro";
6+
import Headline from "@ui/Headline.astro"
7+
import { getCollection } from "astro:content";
8+
9+
let deadlines = await getCollection("deadlines");
10+
deadlines = deadlines
11+
.sort((a, b) => a.slug.localeCompare(b.slug))
12+
.reverse()
13+
.slice(0, 3);
14+
15+
---
16+
<section class="prose-xl m-0 p-0">
17+
<Headline id="updates" title="Updates" />
18+
<CardContainer>
19+
{deadlines.map((deadline) => <DeadlineCard id={deadline.slug} />)}
20+
</CardContainer>
21+
</section>

src/components/sponsors/sponsors.astro

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { getCollection } from "astro:content";
33
import { Separator } from "../separator/separator";
44
import { Fragment } from "react";
55
import { Fullbleed } from "../layout/fullbleed";
6+
import Headline from "@ui/Headline.astro"
67
78
import ButtonLink from "../button-link/button-link.astro";
8-
import { Title } from "../typography/title";
99
1010
import SponsorTier from "./sponsor-tier.astro";
1111
@@ -48,19 +48,17 @@ const topTier = sponsorTiers.find((tier) => tier.name === "Keystone");
4848

4949
<Fullbleed className="bg-white py-24 px-6">
5050
<section class="max-w-4xl lg:max-w-6xl mx-auto mb-16">
51+
<Headline id="sponsors" title="Sponsors" />
5152
<div>
52-
<div class="flex gap-6">
53-
<div class="max-w-[1000px]">
54-
<Title level={2}>Sponsors</Title>
5553
{
5654
hasSponsors ? (
57-
<p>
55+
<p class="text-center">
5856
EuroPython wouldn't be such an affordable event without the help
5957
of the sponsors. We'd like to thank all of them for their
6058
support.
6159
</p>
6260
) : (
63-
<p>
61+
<p class="text-center">
6462
Sponsoring EuroPython guarantees you highly targeted visibility
6563
and the opportunity to present yourself and your company to one
6664
of the largest and most diverse Python communities in Europe and
@@ -69,10 +67,8 @@ const topTier = sponsorTiers.find((tier) => tier.name === "Keystone");
6967
)
7068
}
7169

72-
<div class="mt-4">
70+
<div class="mt-4 text-center">
7371
<ButtonLink url="/sponsor">Become a sponsor</ButtonLink>
74-
</div>
75-
</div>
7672
</div>
7773
{
7874
topTier && topTier.sponsors.length > 0 && (

src/components/ui/Headline.astro

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
const { as = "h2", id, title, href} = Astro.props;
3+
const Tag = as;
4+
const Title = title;
5+
const isAnchor = !!id;
6+
const isLink = !!href;
7+
---
8+
9+
<Tag id={isAnchor ? id : undefined} class={`m-5 py-2 text-center font-bold text-6xl`}>
10+
{isAnchor && (
11+
<a href={`#${id}`} aria-label={`Jump to ${id}`}>
12+
{Title}
13+
</a>
14+
)}
15+
{isLink && <a aria-label="Read more about {Title}" href={href} class="hover:underline">{Title}</a> }
16+
</Tag>

src/layouts/HomePageLayout.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
import "../styles/global.css";
32
import Header from "../components/header/header.astro";
43
import Footer from "../components/footer.astro";
54
import BaseHead from "../components/BaseHead.astro";

src/layouts/Layout.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
import "../styles/global.css";
32
import Header from "../components/header/header.astro";
43
import Footer from "../components/footer.astro";
54
import BaseHead from "../components/BaseHead.astro";

src/pages/index.astro

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
---
2-
import { CardContainer } from "../components/card/card-container";
32
import Hero from "../components/hero2/hero.astro";
4-
import HeroWithCTA from "../components/hero-section/hero-with-cta.astro";
5-
import { Fullbleed } from "../components/layout/fullbleed";
6-
import Prose from "../components/prose/prose.astro";
7-
import { Title } from "../components/typography/title";
83
import Layout from "../layouts/HomePageLayout.astro";
9-
import DeadlineCard from "../components/deadline-card.astro";
10-
import { getCollection } from "astro:content";
11-
import Accent from "../components/accent/accent.astro";
12-
import Prague from "../components/hero-section/prague.astro";
134
import Sponsors from "../components/sponsors/sponsors.astro";
145
import KeynotersComponent from "../components/keynoters/keynoters.astro";
15-
16-
import * as intro from "../data/home/intro.md";
17-
import * as venue from "../data/home/prague.mdx";
18-
19-
let deadlines = await getCollection("deadlines");
20-
deadlines = deadlines
21-
.sort((a, b) => a.slug.localeCompare(b.slug))
22-
.reverse()
23-
.slice(0, 3);
6+
import Updates from "@sections/updates.astro";
7+
import Prague from "@sections/prague.astro";
248
---
259

2610
<Layout
@@ -29,16 +13,11 @@ deadlines = deadlines
2913
>
3014
<Hero />
3115

32-
<h2 class="text-7xl text-center m-16">Updates</h2>
33-
<CardContainer>
34-
{deadlines.map((deadline) => <DeadlineCard id={deadline.slug} />)}
35-
</CardContainer>
16+
<Updates />
17+
18+
<KeynotersComponent />
19+
20+
<Prague />
3621

37-
<KeynotersComponent />
38-
<div class="mt-40 px-6 pb-40 overflow-visible">
39-
<Prague title={venue.frontmatter.title}>
40-
<venue.Content />
41-
</Prague>
42-
</div>
4322
<Sponsors />
4423
</Layout>

0 commit comments

Comments
 (0)