github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/themes/docsy/layouts/shortcodes/blocks/cover.html (about)

     1  {{ $_hugo_config := `{ "version": 1 }` }}
     2  {{ $blockID := printf "td-cover-block-%d" .Ordinal }}
     3  {{ $promo_image := (.Page.Resources.ByType "image").GetMatch "**background*" }}
     4  {{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**logo*" }}
     5  {{ $col_id := .Get "color" | default "dark" }}
     6  {{ $image_anchor := .Get "image_anchor" | default "smart" }}
     7  {{ $logo_anchor := .Get "logo_anchor" | default "smart" }}
     8  {{/* Height can be one of: auto, min, med, max, full. */}}
     9  {{ $height := .Get "height" | default "max" }}
    10  {{ $byline := .Get "byline" | default "" }}
    11  {{ with $promo_image }}
    12  {{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }}
    13  {{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }}
    14  <link rel="preload" as="image" href="{{ $promo_image_small.RelPermalink }}" media="(max-width: 1200px)">
    15  <link rel="preload" as="image" href="{{ $promo_image_big.RelPermalink }}" media="(min-width: 1200px)">
    16  <style>
    17  #{{ $blockID }} {
    18      background-image: url({{ $promo_image_small.RelPermalink }}); 
    19  }
    20  @media only screen and (min-width: 1200px) {
    21      #{{ $blockID }} {
    22          background-image: url({{ $promo_image_big.RelPermalink }}); 
    23      }
    24  }
    25  </style>
    26  {{ end }}
    27  <section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }}{{ if not .Site.Params.ui.navbar_translucent_over_cover_disable }} js-td-cover{{ end }} td-overlay td-overlay--dark -bg-{{ $col_id }}">
    28    <div class="container td-overlay__inner">
    29      <div class="row">
    30        <div class="col-12">
    31          <div class="text-center">
    32            {{ with .Get "title" }}<h1 class="display-1 mt-0 mt-md-5 pb-4">{{ $title := . }}{{ with $logo_image }}{{ $logo_image_resized := (.Fit (printf "70x70 %s" $logo_anchor)) }}<img class="td-cover-logo" src="{{ $logo_image_resized.RelPermalink }}" alt="{{ $title | html }} Logo">{{ end }}{{ $title | html }}</h1>{{ end }}
    33            {{ with .Get "subtitle" }}<p class="display-2 text-uppercase mb-0">{{ . | html }}</p>{{ end }}
    34            <div class="pt-3 lead">
    35              {{ if eq .Page.File.Ext "md" }}
    36                  {{ .Inner | markdownify }}
    37              {{ else }}
    38                  {{ .Inner | htmlUnescape | safeHTML }}
    39              {{ end }}
    40            </div>
    41          </div>
    42        </div>
    43      </div>
    44    </div>
    45    {{ if $byline }}
    46    <div class="byline">
    47      <small>{{ $byline }}</small>
    48    </div>
    49    {{ end }}
    50  </section>