--- import { ClientRouter } from 'astro:transitions'; import NavBar from '@components/scafold/NavBar.astro'; import Footer from '@components/scafold/Footer.astro'; import config from '../site-config'; interface Props { title?: string; // Page title description?: string; // Overide description tag keywords?: string; // Overide keywords tag hideNav?: boolean; // Don't show the navbar (just homepage) author?: string; // Author of the content customSchemaJson?: Record; // Custom schema item breadcrumbs?: Array<{ name: string; item: string; }>; } const { title = config.title, description = config.description, keywords = config.keywords, author = config.author, hideNav = false, breadcrumbs, customSchemaJson, } = Astro.props; // Crumbs arrive as '/', 'api' or 'category/section', so normalise to a canonical URL const crumbUrl = (item: string) => { const path = item.replace(/^\/+|\/+$/g, ''); return `https://awesome-privacy.xyz/${path && `${path}/`}`; }; // Always advertise the trailing-slash form, so server-rendered routes agree with the sitemap const canonical = crumbUrl(Astro.url.pathname); const makeBreadcrumbs = () => { if (!breadcrumbs) return null; return { '@context': 'https://schema.org', '@type': 'BreadcrumbList', itemListElement: breadcrumbs.map((breadcrumb, index) => ({ '@type': 'ListItem', position: index + 1, name: breadcrumb.name, item: crumbUrl(breadcrumb.item), })), }; }; const makeSearchLd = () => { return { '@context': 'https://schema.org', '@type': 'WebSite', name: 'Awesome Privacy', url: 'https://awesome-privacy.xyz/', potentialAction: [ { '@type': 'SearchAction', target: { '@type': 'EntryPoint', urlTemplate: 'https://awesome-privacy.xyz/search/{search_term_string}/', }, 'query-input': 'required name=search_term_string', }, ], }; }; --- {title} { breadcrumbs && (