Porządkowanie kodu, dodanie sekcji wyszukiwania kanałów
This commit is contained in:
@@ -2,27 +2,21 @@
|
||||
import yaml from "js-yaml";
|
||||
import fs from "fs";
|
||||
|
||||
// SEO z YAML (np. import seo from "../content/seo/home.yaml")
|
||||
const seo = Astro.props.seo ?? {};
|
||||
|
||||
// Global SEO (site + company)
|
||||
const globalSeo = yaml.load(
|
||||
fs.readFileSync("./src/content/seo/home.yaml", "utf8")
|
||||
fs.readFileSync("./src/content/home/seo.yaml", "utf8")
|
||||
);
|
||||
|
||||
const { site, company } = globalSeo;
|
||||
|
||||
// Page SEO (sekcja "page" w YAML)
|
||||
const page = seo.page ?? {};
|
||||
|
||||
// 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 ?? [];
|
||||
|
||||
// Extra structured data (optional)
|
||||
const extraSchema = page.schema ?? null;
|
||||
|
||||
// JSON-LD objects
|
||||
|
||||
Reference in New Issue
Block a user