104 lines
4.6 KiB
HTML
104 lines
4.6 KiB
HTML
<!doctype html>
|
|
<html
|
|
lang="{{ with site.Params.isoCode | default (site.Language.Locale | default `en`) }}{{- . -}}{{ end }}"
|
|
dir="{{ cond (site.Params.rtl | default false) `rtl` `ltr` }}"
|
|
class="scroll-smooth"
|
|
data-default-appearance="{{ site.Params.defaultAppearance | default `light` }}"
|
|
data-auto-appearance="{{ site.Params.autoSwitchAppearance | default `true` }}">
|
|
{{- partial "head.html" . -}}
|
|
{{- partialCached "init.html" . -}}
|
|
|
|
{{ $bodyLayout := "flex flex-col h-screen m-auto leading-7 max-w-7xl px-6 sm:px-14 md:px-24 lg:px-32" }}
|
|
|
|
{{/* Global Background Logic */}}
|
|
{{ $useGlobalBg := false }}
|
|
{{ $bgImage := "" }}
|
|
{{ if site.Params.defaultBackgroundImage }}
|
|
{{ $useGlobalBg = true }}
|
|
{{ $bgImage = site.Params.defaultBackgroundImage }}
|
|
{{ if .IsHome }}
|
|
{{ if or (eq .Site.Params.homepage.layout "background") (eq .Site.Params.homepage.layout "hero") }}
|
|
{{ if .Site.Params.homepage.homepageImage }}{{ $useGlobalBg = false }}{{ end }}
|
|
{{ end }}
|
|
{{ else if .IsPage }}
|
|
{{ $heroStyle := .Params.heroStyle | default (.Site.Params.article.heroStyle | default "basic") }}
|
|
{{ if or (eq $heroStyle "background") (eq $heroStyle "hero") }}
|
|
{{ if .Params.featureimage }}{{ $useGlobalBg = false }}{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $bodyColor := "text-lg bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral" }}
|
|
{{ if $useGlobalBg }}
|
|
{{ $bodyColor = "text-lg text-neutral-900 dark:text-neutral" }}
|
|
{{ end }}
|
|
|
|
{{ $globalBgClass := cond $useGlobalBg "has-global-bg" "" }}
|
|
|
|
<body class="{{ $bodyLayout }} {{ $bodyColor }} {{ with .Params.bodyClass }}{{ . }}{{ end }} {{ $globalBgClass }} {{ if site.Params.enableStyledScrollbar | default true }}bf-scrollbar{{ end }}">
|
|
|
|
{{ if $useGlobalBg }}
|
|
{{ $bgURL := "" }}
|
|
{{ if or (strings.HasPrefix $bgImage "http:") (strings.HasPrefix $bgImage "https:") }}
|
|
{{ $bgURL = $bgImage }}
|
|
{{ else }}
|
|
{{ $bgResource := resources.Get $bgImage }}
|
|
{{ if $bgResource }}
|
|
{{ $bgURL = $bgResource.RelPermalink }}
|
|
{{ else }}
|
|
{{ $bgURL = $bgImage | relURL }}
|
|
{{ end }}
|
|
{{ end }}
|
|
<div id="global-background" class="fixed inset-0 overflow-hidden pointer-events-none single_hero_background nozoom" style="z-index: -1;">
|
|
{{ $style := "" }}
|
|
{{ $defaultPosition := site.Params.imagePosition | default false }}
|
|
{{ if $defaultPosition }}
|
|
{{ $style = printf "object-position: %s;" $defaultPosition }}
|
|
{{ end }}
|
|
<img src="{{ $bgURL }}" class="absolute inset-0 w-full h-[1000px] md:h-[1200px] object-cover" role="presentation" {{ if $style }}style="{{ $style | safeCSS }}"{{ end }}>
|
|
<div class="absolute inset-0 h-[1000px] md:h-[1200px] bg-neutral/60 dark:bg-neutral-800/60 mix-blend-normal"></div>
|
|
</div>
|
|
{{ end }}
|
|
|
|
<div id="the-top" class="absolute flex self-center">
|
|
<a
|
|
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
|
|
href="#main-content">
|
|
<span class="font-bold text-primary-600 pe-2 dark:text-primary-400">↓</span>
|
|
{{ i18n "nav.skip_to_main" }}
|
|
</a>
|
|
</div>
|
|
{{ $header := print "header/" site.Params.header.layout ".html" }}
|
|
{{ if templates.Exists ( printf "partials/%s" $header ) }}
|
|
{{ partial $header . }}
|
|
{{ else }}
|
|
{{ partial "header/basic.html" . }}
|
|
{{ end }}
|
|
<div class="relative flex flex-col grow">
|
|
<main id="main-content" class="grow">
|
|
{{ block "main" . }}{{ end }}
|
|
{{ if and (site.Params.footer.showScrollToTop | default true) }}
|
|
{{- partial "scroll-to-top.html" . -}}
|
|
{{ end }}
|
|
</main>
|
|
{{- partial "footer.html" . -}}
|
|
{{ if site.Params.enableSearch | default false }}
|
|
{{- partial "search.html" . -}}
|
|
{{ end }}
|
|
</div>
|
|
</body>
|
|
{{ if site.Params.buymeacoffee.globalWidget | default false }}
|
|
<script
|
|
data-name="BMC-Widget"
|
|
data-cfasync="false"
|
|
src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
|
|
data-id="{{ site.Params.buymeacoffee.identifier }}"
|
|
data-description="Support me on Buy me a coffee!"
|
|
{{ with site.Params.buymeacoffee.globalWidgetMessage }}data-message="{{ . }}"{{ end }}
|
|
{{ with site.Params.buymeacoffee.globalWidgetColor | default `#FFDD00` }}data-color="{{ . }}"{{ end }}
|
|
{{ with site.Params.buymeacoffee.globalWidgetPosition }}data-position="{{ . }}"{{ end }}
|
|
data-x_margin="18"
|
|
data-y_margin="18"></script>
|
|
{{ end }}
|
|
</html>
|