{{- $brand := "Anthias" -}} {{- $defaultDescription := "Anthias is the world's most popular open source digital signage solution. Turn any Raspberry Pi or PC into a powerful digital sign displaying images, videos, and web pages." -}} {{- $description := default $defaultDescription .Params.description -}} {{- $titleSuffix := "" -}} {{- if and (not .IsHome) (not (in .Title $brand)) -}} {{- $titleSuffix = printf " | %s" $brand -}} {{- end -}} {{- $pageTitle := printf "%s%s" .Title $titleSuffix -}} {{- /* OG/Twitter card image. Prefer the first marketing slide if the screenshots dir has been populated (CI artifact / local fetch); otherwise fall back to the static logo so the crawler always gets *something*. */ -}} {{- $pageImage := "" -}} {{- $pageImageAlt := "Anthias logo" -}} {{- /* Stable string key — the partial reads only site.Data and bundled resources, so memoising once per build (instead of per-page via "." which differs across pages) is correct and avoids re-running the Resize pipeline for every page. */ -}} {{- $heroSlides := partialCached "screenshots.html" . "screenshots-singleton" -}} {{- if $heroSlides -}} {{- $first := index $heroSlides 0 -}} {{- $pageImage = $first.fallback | absURL -}} {{- with $first.alt -}}{{- $pageImageAlt = . -}}{{- end -}} {{- else -}} {{- with resources.Get "images/logo.svg" -}} {{- $pageImage = .Permalink -}} {{- end -}} {{- end -}} {{ $pageTitle }} {{- $favicon := resources.Get "images/favicon.ico" -}} {{- $style := resources.Get "styles/style.css" | fingerprint -}} {{- /* Preload primary font weights so text renders without a FOUT. Latin only — latin-ext loads on demand via unicode-range. */ -}} {{- /* Preload the LCP hero image on the home page — only the first slide of the screenshot slider. Subsequent slides come in via lazy as the user scrolls/advances. */ -}} {{- if and .IsHome $heroSlides -}} {{- $first := index $heroSlides 0 -}} {{- end }} {{- /* chroma.css is only needed on pages that produce highlighted code blocks. Hugo wraps each block in
,
           so that exact attribute is the precise sentinel — looser
           matches like "chroma" alone would false-positive on prose.
           The faq layout renders answers from data/faq.yaml via
           markdownify, so its highlighted output is not in .Content
           and we have to special-case it. */ -}}
    {{- $needsChroma := or (strings.Contains .Content `class="chroma"`) (eq .Layout "faq") -}}
    {{- if $needsChroma -}}
      {{- $chroma := resources.Get "styles/chroma.css" | fingerprint -}}
    
    {{- end }}

    {{ if .IsHome }}
    
    {{ end }}

    {{- /* FAQPage structured data — generated from data/faq.yaml */ -}}
    {{ if eq .Layout "faq" }}
    
    {{ end }}

    {{- /* Screenshot slider script — only on the home page where the
           slider markup exists. js.Build runs esbuild internally
           (target=es2020, minify=true) so the published artifact is
           a small, tree-shaken bundle. `defer` lets the browser
           parse it without blocking LCP; fingerprint busts caches
           on next deploy. */ -}}
    {{- if and .IsHome $heroSlides -}}
      {{- $sliderOpts := dict "targetPath" "js/slider.js" "minify" true "target" "es2020" -}}
      {{- $slider := resources.Get "js/slider.ts" | js.Build $sliderOpts | fingerprint -}}
    
    {{- end }}

    {{- /* Article structured data on individual docs pages */ -}}
    {{ if and .IsPage (eq (string .Section) "docs") }}
    
    {{ end }}
  
  
    {{ partial "navbar.html" . }}

    {{ block "main" . }}{{ end }}

    {{ partial "footer.html" . }}