Przebudowa stron na indywidualne karty , pobierane z bazy danych

This commit is contained in:
dm
2025-12-11 15:25:00 +01:00
parent 49c5beb362
commit 0cf7c45131
27 changed files with 1133 additions and 420 deletions

View File

@@ -1,9 +1,7 @@
---
import DefaultLayout from "../../layouts/DefaultLayout.astro";
import Hero from "../../components/hero/Hero.astro";
import SectionRenderer from "../../components/sections/SectionRenderer.astro";
import Markdown from "../../islands/Markdown.jsx";
import OffersIsland from "../../islands/OffersIsland.jsx";
import OffersPhoneCards from "../../islands/OffersPhoneCards.jsx";
import yaml from "js-yaml";
import fs from "fs";
@@ -11,44 +9,18 @@ import fs from "fs";
const seo = yaml.load(
fs.readFileSync("./src/content/telefon/seo.yaml", "utf8"),
);
const hero = yaml.load(
fs.readFileSync("./src/content/telefon/hero.yaml", "utf8"),
);
const page = yaml.load(
fs.readFileSync("./src/content/telefon/page.yaml", "utf8"),
);
type Paragraph = {
title?: string;
content: string;
};
const data = yaml.load(
fs.readFileSync("./src/content/telefon/offers.yaml", "utf8"),
);
const first = page.paragraphs[0];
const rest = page.paragraphs.slice(1);
---
<DefaultLayout seo={seo}>
<Hero {...hero} />
<section class="f-section">
<div class="f-section-grid-single md:grid-cols-1">
{page.title.map((line: any) => <h1 class="f-section-title">{line}</h1>)}
{first.title && <h3>{first.title}</h3>}
<Markdown text={first.content} />
</div>
</section>
<section class="f-section">
<div class="f-section-grid-single md:grid-cols-1">
<OffersIsland client:load data={data} />
<h1 class="f-section-title">Usługa telefonu</h1>
<OffersPhoneCards client:load />
</div>
</section>
<!-- <OffersIsland client:load data={data} /> -->
{
<!-- {
rest.map((p: Paragraph) => (
<section class="f-section">
<div class="f-section-grid-single md:grid-cols-1">
@@ -57,7 +29,7 @@ const rest = page.paragraphs.slice(1);
</div>
</section>
))
}
} -->
<SectionRenderer src="./src/content/telefon/section.yaml" />
</DefaultLayout>