Skip to content

Commit

Permalink
refactor: update spacing for layout
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhoffmnn committed Nov 15, 2023
1 parent ec2d574 commit ccb33a0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
17 changes: 1 addition & 16 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,12 @@ import Navbar from "@/components/general/Navbar.astro";
import { info } from "@/data/info";
import { SEO } from "astro-seo";
function getSpacing(spacing?: "sm" | "md" | "lg") {
switch (spacing) {
case "sm":
return "space-y-16";
case "md":
return "space-y-20";
case "lg":
return "space-y-24";
default:
return "space-y-20";
}
}
interface Props {
frontmatter: { title?: string; description: string; ogImageUrl?: string; label: string };
spacing?: "sm" | "md" | "lg";
}
const {
frontmatter: { title, description, ogImageUrl, label },
spacing,
} = Astro.props;
---

Expand Down Expand Up @@ -87,7 +72,7 @@ const {
/>
</head><body>
<Navbar />
<main class={`container ${getSpacing(spacing)}`} aria-label={label}>
<main class={`container space-y-16 md:space-y-20 lg:space-y-24`} aria-label={label}>
<slot />
</main>
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { info } from "@/data/info";
import Layout from "@/layouts/Layout.astro";
---

<Layout frontmatter={{ description: info.about[0], label: "Startseite mit Lebenslauf" }} spacing="md">
<Layout frontmatter={{ description: info.about[0], label: "Startseite mit Lebenslauf" }}>
<Hero name={info.name} about={info.about} gradient={true} />
<ExperienceWrapper title={"Erfahrung"} details={info.experience} />
<ExperienceWrapper title={"Ausbildung"} details={info.education} />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const { Content } = await entry.render();
docsUrl={data.docsUrl}
/>
<Image
class="my-16 aspect-[2/1] h-full w-full overflow-hidden rounded-xl object-cover object-center brightness-90"
class="aspect-[4/3] h-full w-full overflow-hidden rounded-xl object-cover object-center brightness-90 sm:aspect-[2/1]"
src={data.thumbnail}
loading="eager"
width={800}
Expand Down
5 changes: 1 addition & 4 deletions src/pages/projects/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import Layout from "@/layouts/Layout.astro";
const title = "Projekte";
---

<Layout
frontmatter={{ title: title, description: "Übersicht über meine Projekte.", label: "Projektübersicht" }}
spacing="sm"
>
<Layout frontmatter={{ title: title, description: "Übersicht über meine Projekte.", label: "Projektübersicht" }}>
<PageHeader title={title} description="Kunden- und Studiumsprojekte" />
<ProjectGrid lazy={false} />
</Layout>

0 comments on commit ccb33a0

Please sign in to comment.