diff --git a/package.json b/package.json index cd731f2..3ad7268 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@astrojs/preact": "^4.1.3", "@preact/signals": "^2.5.1", "astro": "^5.16.0", + "globby": "^16.0.0", "js-yaml": "^4.1.0", "marked": "^17.0.1", "preact": "^10.27.2" diff --git a/src/content/internet-swiatlowodowy/hero.yaml b/src/content/internet-swiatlowodowy/hero.yaml index 03f3093..0468c5c 100644 --- a/src/content/internet-swiatlowodowy/hero.yaml +++ b/src/content/internet-swiatlowodowy/hero.yaml @@ -16,7 +16,7 @@ ctas: href: "/internet-telewizja" primary: false - label: "Zobacz ofertę Internetu Radiowego" - href: "/internet-radio" + href: "/internet-radiowy" primary: false # - label: "Sprawdź dostępność" # href: "/mapa-zasiegu" diff --git a/src/content/internet-swiatlowodowy/seo.yaml b/src/content/internet-swiatlowodowy/seo.yaml index 1ec4261..a2dd086 100644 --- a/src/content/internet-swiatlowodowy/seo.yaml +++ b/src/content/internet-swiatlowodowy/seo.yaml @@ -1,6 +1,6 @@ site: name: "FUZ – Internet światłowodowy i radiowy w Wyszkowie" - description: "Stabilny i szybki internet" + description: "Stabilny i szybki internet w Wyszkowie i okolicach" url: "https://www.fuz.pl" lang: "pl" @@ -15,3 +15,15 @@ company: lat: 52.597385 lon: 21.456797 logo: "/images/logo-fuz.webp" + +page: + title: "FUZ – Internet światłowodowy i radiowy w Wyszkowie" + description: "Szybki, stabilny internet światłowodowy i radiowy w Wyszkowie. Lokalny operator, realny serwis, błyskawiczne wsparcie." + image: "/images/og-home.webp" + url: "/" + keywords: + - internet Wyszków + - światłowód Wyszków + - internet radiowy Wyszków + - lokalny operator internetu + schema: {} diff --git a/src/layouts/BaseHead.astro b/src/layouts/BaseHead.astro index 1fb9eac..7553f36 100644 --- a/src/layouts/BaseHead.astro +++ b/src/layouts/BaseHead.astro @@ -2,41 +2,43 @@ import yaml from "js-yaml"; import fs from "fs"; -const { seo } = Astro.props; +// SEO z YAML (np. import seo from "../content/seo/home.yaml") +const seo = Astro.props.seo ?? {}; -// Load global SEO config +// Global SEO (site + company) const globalSeo = yaml.load( fs.readFileSync("./src/content/seo/home.yaml", "utf8") ); const { site, company } = globalSeo; -const { - title = site.name, - description = site.description, - url = "/", - image = site.logo, - keywords = [], - schema = {} -} = seo ?? {}; +// Page SEO (sekcja "page" w YAML) +const page = seo.page ?? {}; -const canonical = site.url + url; +// FINAL VALUES +const title = page.title ?? site.name; +const description = page.description ?? site.description; +const image = page.image ?? site.logo; +const canonical = site.url + (page.url ?? "/"); +const keywords = page.keywords ?? []; -/* PREPARE JSON-LD AS SAFE STRINGS */ +// Extra structured data (optional) +const extraSchema = page.schema ?? null; -const schemaWebsite = JSON.stringify({ +// JSON-LD objects +const schemaWebsite = { "@context": "https://schema.org", "@type": "WebSite", "url": site.url, "name": site.name, "potentialAction": { "@type": "SearchAction", - "target": site.url + "/wyszukiwarka?query={search_term_string}", + "target": `${site.url}/wyszukiwarka?query={search_term_string}`, "query-input": "required name=search_term_string" } -}); +}; -const schemaLocalBusiness = JSON.stringify({ +const schemaLocalBusiness = { "@context": "https://schema.org", "@type": "LocalBusiness", "name": company.name, @@ -56,13 +58,14 @@ const schemaLocalBusiness = JSON.stringify({ "longitude": company.lon }, "url": site.url -}); +}; -/* Extra schema if passed from page */ -const schemaExtra = Object.keys(schema).length > 0 - ? JSON.stringify(schema) - : null; +// JSON strings +const jsonWebsite = JSON.stringify(schemaWebsite); +const jsonBusiness = JSON.stringify(schemaLocalBusiness); +const jsonExtra = extraSchema ? JSON.stringify(extraSchema) : null; --- +
@@ -76,7 +79,7 @@ const schemaExtra = Object.keys(schema).length > 0 - + @@ -90,15 +93,15 @@ const schemaExtra = Object.keys(schema).length > 0 - - + + - - + + - - {schemaExtra && ( - + + {jsonExtra && ( + )}