53 lines
2.2 KiB
Plaintext
53 lines
2.2 KiB
Plaintext
---
|
|
import Header from '../components/Header.astro';
|
|
import Footer from '../components/Footer.astro';
|
|
import Seo from '../components/Seo.astro';
|
|
import site from '../data/site.json';
|
|
import { getPublication, getRoutePublicationManifest } from '../utils/publication';
|
|
import type { VisitorLocale, VisitorPublication } from '../utils/visitor-navigation';
|
|
import '../styles/global.css';
|
|
import '../styles/rtl.css';
|
|
const { title, description, image, lang = 'en', type = 'website' } = Astro.props;
|
|
const publication = await getPublication(Astro.url.pathname);
|
|
const manifest = await getRoutePublicationManifest() as VisitorPublication[];
|
|
// Reuse alt text only for the image it describes, not a fallback banner image.
|
|
const imageAlt = image && image === publication.entry.data.featuredImage
|
|
? publication.entry.data.alt
|
|
: undefined;
|
|
const dir = lang === 'ar' ? 'rtl' : 'ltr';
|
|
const skipLink = { en: 'Skip to content', es: 'Saltar al contenido', ar: 'انتقل إلى المحتوى' }[lang as VisitorLocale] ?? 'Skip to content';
|
|
const organizationSchema = {
|
|
'@context': 'https://schema.org',
|
|
'@type': 'MedicalOrganization',
|
|
name: site.name,
|
|
url: site.url,
|
|
// Contact details are rendered through ContactObfuscation to avoid plain text in HTML.
|
|
address: {
|
|
'@type': 'PostalAddress',
|
|
streetAddress: '8901 E Raintree Dr Ste 160',
|
|
addressLocality: 'Scottsdale',
|
|
addressRegion: 'AZ',
|
|
postalCode: '85260',
|
|
addressCountry: 'US'
|
|
},
|
|
sameAs: Object.values(site.social)
|
|
};
|
|
---
|
|
<!doctype html>
|
|
<html lang={lang} dir={dir}>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<link rel="icon" href="/assets/images/favicon.svg" />
|
|
<Seo title={title} description={description} publication={publication} image={image} imageAlt={imageAlt} type={type} />
|
|
<slot name="head" />
|
|
<script type="application/ld+json" is:inline set:html={JSON.stringify(organizationSchema)} />
|
|
</head>
|
|
<body>
|
|
<a class="skip-link" href="#main">{skipLink}</a>
|
|
<Header lang={lang as VisitorLocale} publication={publication as VisitorPublication} manifest={manifest} />
|
|
<main id="main"><slot /></main>
|
|
<Footer lang={lang as VisitorLocale} manifest={manifest} />
|
|
</body>
|
|
</html>
|