seahaven-site/_includes/base.njk
Adam Moussa 87d5dd5d0a perf: self-host fonts + lazy-load reCAPTCHA
Self-host DM Serif Display (regular+italic) and Inter (variable) as
latin-subset woff2 (~84KB), with @font-face + font-display:swap and
preloads. Removes render-blocking Google Fonts (2 third-party origins,
extra DNS/preconnect). reCAPTCHA api.js is no longer eager-loaded in
<head>; form.js injects it on first form focus/submit, keeping ~50KB+
of third-party JS off initial load on form pages. CloudFront CSP
font-src updated to allow 'self' (additive; gstatic kept for transition).
2026-06-12 17:26:14 -04:00

58 lines
2.3 KiB
Text

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<meta property="og:title" content="{{ ogTitle or title }}">
<meta property="og:description" content="{{ ogDescription or description }}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
<meta property="og:site_name" content="{{ site.name }}">
<meta property="og:image" content="{{ site.ogImage }}">
<meta property="og:locale" content="{{ site.locale }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ ogTitle or title }}">
<meta name="twitter:description" content="{{ ogDescription or description }}">
<meta name="twitter:image" content="{{ site.ogImage }}">
<meta name="robots" content="{{ robots or 'index, follow, max-image-preview:large' }}">
<link rel="canonical" href="{{ site.url }}{{ page.url }}">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32.png">
<link rel="apple-touch-icon" sizes="192x192" href="/assets/images/favicon-192.png">
<link rel="preload" href="/assets/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/dm-serif-display.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/assets/css/main.css">
{%- if pageCss %}
<link rel="stylesheet" href="/assets/css/{{ pageCss }}.css">
{%- endif %}
{%- if heroNav %}
<link rel="preload" as="image" href="/assets/images/hero-bg.webp" fetchpriority="high">
{%- endif %}
{%- block head %}{% endblock %}
{#- reCAPTCHA is lazy-loaded by form.js on first form interaction (see recaptcha pages) #}
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
{% include "nav.njk" %}
{% include "mobile-menu.njk" %}
<main id="main-content">
{{ content | safe }}
</main>
{% include "footer.njk" %}
{%- if breadcrumbName %}
{% include "breadcrumb-ld.njk" %}
{%- endif %}
<script src="/assets/js/nav.js" defer></script>
{%- if recaptcha %}
<script src="/assets/js/form.js" defer></script>
{%- endif %}
</body>
</html>