From e76cd1788c0cd05dbc7b4b0b18a7f50cc92a5a58 Mon Sep 17 00:00:00 2001 From: dm Date: Sat, 20 Dec 2025 13:53:20 +0100 Subject: [PATCH] =?UTF-8?q?Dokumenty=20-=20wyr=C3=B3wnywanie=20tytu=C5=82o?= =?UTF-8?q?w.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dokumenty/index.astro | 22 ++--- src/pages/internet-swiatlowodowy/index.astro | 91 +++++++++++++++----- src/styles/cards.css | 4 +- src/styles/sections.css | 4 + 4 files changed, 82 insertions(+), 39 deletions(-) diff --git a/src/pages/dokumenty/index.astro b/src/pages/dokumenty/index.astro index 30fabe6..06eef0a 100644 --- a/src/pages/dokumenty/index.astro +++ b/src/pages/dokumenty/index.astro @@ -5,12 +5,10 @@ import fs from "node:fs"; import Markdown from "../../islands/Markdown.jsx"; import "../../styles/document.css"; -/* ===== Typy ===== */ - type DocFile = { nazwa?: string; - file?: string; // pdf - slug?: string; // yaml / czytaj + file?: string; + slug?: string; }; type DocGroup = { @@ -24,8 +22,6 @@ type DocsYaml = { grupy?: Record; }; -/* ===== Load YAML ===== */ - const doc = yaml.load( fs.readFileSync("./src/content/document/documents.yaml", "utf8"), ) as DocsYaml; @@ -37,8 +33,6 @@ const groups = doc?.grupy ?? {}; const left = groups["otworz"] ?? {}; const right = groups["pobierz"] ?? {}; -/* ===== Helpers ===== */ - function normalizePublicHref(input?: string) { let s = String(input ?? "").trim(); if (!s) return ""; @@ -49,13 +43,11 @@ function normalizePublicHref(input?: string) { --- - {/* CONTENT */}
-
+
- {/* ===== LEWA — CZYTAJ ===== */}
-

{left.tytul ?? "Przeczytaj"}

+

{left.tytul ?? "Przeczytaj"}

{!left.pliki?.length ? (

Brak dokumentów.

@@ -68,9 +60,7 @@ function normalizePublicHref(input?: string) { href={`/dokumenty/${p.slug}`} title={p.nazwa} > - {/*
📖
*/}
{p.nazwa}
- {/*
Otwórz
*/} ) : null ))} @@ -79,7 +69,7 @@ function normalizePublicHref(input?: string) {
-

{right.tytul ?? "Pobierz"}

+

{right.tytul ?? "Pobierz"}

{!right.pliki?.length ? (

Brak plików.

@@ -106,4 +96,4 @@ function normalizePublicHref(input?: string) {
-
+ \ No newline at end of file diff --git a/src/pages/internet-swiatlowodowy/index.astro b/src/pages/internet-swiatlowodowy/index.astro index 3e097b3..af926d9 100644 --- a/src/pages/internet-swiatlowodowy/index.astro +++ b/src/pages/internet-swiatlowodowy/index.astro @@ -10,8 +10,19 @@ import { loadYamlFile } from "../../lib/loadYaml"; type SeoYaml = any; type InternetParam = { klucz: string; label: string; value: string | number }; -type InternetCena = { budynek: number | string; umowa: number | string; miesiecznie: number; aktywacja?: number }; -type InternetCard = { nazwa: string; widoczny?: boolean; popularny?: boolean; parametry?: InternetParam[]; ceny?: InternetCena[] }; +type InternetCena = { + budynek: number | string; + umowa: number | string; + miesiecznie: number; + aktywacja?: number; +}; +type InternetCard = { + nazwa: string; + widoczny?: boolean; + popularny?: boolean; + parametry?: InternetParam[]; + ceny?: InternetCena[]; +}; type InternetCardsYaml = { tytul?: string; opis?: string; @@ -22,18 +33,46 @@ type InternetCardsYaml = { }; type PhoneParam = { klucz: string; label: string; value: string | number }; -type PhoneCard = { nazwa: string; widoczny?: boolean; popularny?: boolean; cena?: { wartosc: number; opis?: string }; parametry?: PhoneParam[] }; +type PhoneCard = { + nazwa: string; + widoczny?: boolean; + popularny?: boolean; + cena?: { wartosc: number; opis?: string }; + parametry?: PhoneParam[]; +}; type PhoneCardsYaml = { cards?: PhoneCard[] }; -type Addon = { id: string; nazwa: string; typ?: string; ilosc?: boolean; min?: number; max?: number; krok?: number; opis?: string; cena: number }; +type Addon = { + id: string; + nazwa: string; + typ?: string; + ilosc?: boolean; + min?: number; + max?: number; + krok?: number; + opis?: string; + cena: number; +}; type AddonsYaml = { cena_opis?: string; dodatki?: Addon[] }; const seo = loadYamlFile( - path.join(process.cwd(), "src", "content", "internet-swiatlowodowy", "seo.yaml"), + path.join( + process.cwd(), + "src", + "content", + "internet-swiatlowodowy", + "seo.yaml", + ), ); const data = loadYamlFile( - path.join(process.cwd(), "src", "content", "internet-swiatlowodowy", "cards.yaml"), + path.join( + process.cwd(), + "src", + "content", + "internet-swiatlowodowy", + "cards.yaml", + ), ); const phoneData = loadYamlFile( @@ -41,7 +80,13 @@ const phoneData = loadYamlFile( ); const addonsData = loadYamlFile( - path.join(process.cwd(), "src", "content", "internet-swiatlowodowy", "addons.yaml"), + path.join( + process.cwd(), + "src", + "content", + "internet-swiatlowodowy", + "addons.yaml", + ), ); const tytul = data?.tytul ?? ""; @@ -51,17 +96,21 @@ const uwaga = data?.uwaga ?? ""; const waluta = data?.waluta ?? "PLN"; const cenaOpis = data?.cena_opis ?? "zł/mies."; -const cards = (Array.isArray(data?.cards) - ? data.cards.filter((c) => c?.widoczny === true) - : []) as InternetCard[]; +const cards = ( + Array.isArray(data?.cards) + ? data.cards.filter((c) => c?.widoczny === true) + : [] +) as InternetCard[]; -const phoneCards = (Array.isArray(phoneData?.cards) - ? phoneData.cards.filter((c) => c?.widoczny === true) - : []) as PhoneCard[]; +const phoneCards = ( + Array.isArray(phoneData?.cards) + ? phoneData.cards.filter((c) => c?.widoczny === true) + : [] +) as PhoneCard[]; -const addons = (Array.isArray(addonsData?.dodatki) - ? addonsData.dodatki - : []) as Addon[]; +const addons = ( + Array.isArray(addonsData?.dodatki) ? addonsData.dodatki : [] +) as Addon[]; const addonsCenaOpis = addonsData?.cena_opis ?? cenaOpis; @@ -79,9 +128,9 @@ const switchesData = loadYamlFile( path.join(process.cwd(), "src", "content", "site", "switches.yaml"), ); -const switches = (Array.isArray(switchesData?.switches) - ? switchesData.switches - : []) as SwitchDef[]; +const switches = ( + Array.isArray(switchesData?.switches) ? switchesData.switches : [] +) as SwitchDef[]; --- @@ -100,9 +149,9 @@ const switches = (Array.isArray(switchesData?.switches) addonsCenaOpis={addonsCenaOpis} switches={switches} /> +

* {uwaga}

-

* {uwaga}

-
\ No newline at end of file + diff --git a/src/styles/cards.css b/src/styles/cards.css index f047bb1..452170a 100644 --- a/src/styles/cards.css +++ b/src/styles/cards.css @@ -1,6 +1,6 @@ -.f-offers { +/* .f-offers { @apply my-6; -} +} */ .f-offers-grid { @apply flex flex-wrap justify-center gap-8; diff --git a/src/styles/sections.css b/src/styles/sections.css index 1608bc3..61d7bee 100644 --- a/src/styles/sections.css +++ b/src/styles/sections.css @@ -13,6 +13,10 @@ @apply f-section text-center; } +.f-section-grid-top { + @apply grid gap-5 max-w-7xl mx-auto mt-8; +} + .f-section-grid { @apply grid items-center gap-5 max-w-7xl mx-auto mt-8; }