diff options
author | Dimitri Staessens <[email protected]> | 2019-10-06 21:10:46 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2019-10-06 21:10:46 +0200 |
commit | 568553394d0a8b34668a75c9839a0f1f426469b2 (patch) | |
tree | 175c08844f05611b059ba6900fb6519dbbc735d2 /themes/docsy/layouts/shortcodes/blocks | |
parent | d5d6f70371958eec0679831abd283498ff2731e5 (diff) | |
download | website-568553394d0a8b34668a75c9839a0f1f426469b2.tar.gz website-568553394d0a8b34668a75c9839a0f1f426469b2.zip |
theme: Switch to docsy theme
Diffstat (limited to 'themes/docsy/layouts/shortcodes/blocks')
-rw-r--r-- | themes/docsy/layouts/shortcodes/blocks/cover.html | 40 | ||||
-rw-r--r-- | themes/docsy/layouts/shortcodes/blocks/feature.html | 10 | ||||
-rw-r--r-- | themes/docsy/layouts/shortcodes/blocks/lead.html | 12 | ||||
-rw-r--r-- | themes/docsy/layouts/shortcodes/blocks/link-down.html | 7 | ||||
-rw-r--r-- | themes/docsy/layouts/shortcodes/blocks/section.html | 12 |
5 files changed, 81 insertions, 0 deletions
diff --git a/themes/docsy/layouts/shortcodes/blocks/cover.html b/themes/docsy/layouts/shortcodes/blocks/cover.html new file mode 100644 index 0000000..5e14d6d --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/cover.html @@ -0,0 +1,40 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $blockID := printf "td-cover-block-%d" .Ordinal }} +{{ $promo_image := (.Page.Resources.ByType "image").GetMatch "**background*" }} +{{ $logo_image := (.Page.Resources.ByType "image").GetMatch "**logo*" }} +{{ $col_id := .Get "color" | default "dark" }} +{{ $image_anchor := .Get "image_anchor" | default "smart" }} +{{ $logo_anchor := .Get "logo_anchor" | default "smart" }} +{{/* Height can be one of: auto, min, med, max, full. */}} +{{ $height := .Get "height" | default "max" }} +{{ with $promo_image }} +{{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }} +{{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }} +<link rel="preload" as="image" href="{{ $promo_image_small.RelPermalink }}" media="(max-width: 1200px)"> +<link rel="preload" as="image" href="{{ $promo_image_big.RelPermalink }}" media="(min-width: 1200px)"> +<style> +#{{ $blockID }} { + background-image: url({{ $promo_image_small.RelPermalink }}); +} +@media only screen and (min-width: 1200px) { + #{{ $blockID }} { + background-image: url({{ $promo_image_big.RelPermalink }}); + } +} +</style> +{{ end }} +<section id="{{ $blockID }}" class="row td-cover-block td-cover-block--height-{{ $height }} js-td-cover td-overlay td-overlay--dark -bg-{{ $col_id }}"> + <div class="container td-overlay__inner"> + <div class="row"> + <div class="col-12"> + <div class="text-center"> + {{ 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 }} + {{ with .Get "subtitle" }}<p class="display-2 text-uppercase mb-0">{{ . | html }}</p>{{ end }} + <div class="pt-3 lead"> + {{ .Inner | markdownify}} + </div> + </div> + </div> + </div> + </div> +</section> diff --git a/themes/docsy/layouts/shortcodes/blocks/feature.html b/themes/docsy/layouts/shortcodes/blocks/feature.html new file mode 100644 index 0000000..d734dfb --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/feature.html @@ -0,0 +1,10 @@ +{{ $icon := .Get "icon" | default "fa-lightbulb" }} +{{ $url_text := .Get "url_text" }} +<div class="col-lg-4 mb-5 mb-lg-0 text-center "> + <div class="mb-4 h1"> + <i class="{{ if not (or (hasPrefix $icon "fas ") (hasPrefix $icon "fab ")) }}fas {{ end }}{{ $icon }}"></i> + </div> + <h4 class="h3">{{ .Get "title" | markdownify }}</h4> + <p class="mb-0">{{ .Inner }}</p> + {{ with .Get "url" }}<p><a href="{{ . }}">{{ with $url_text }}{{ $url_text }}{{ else }}{{ T "ui_read_more" }}{{ end }} …</a></p>{{ end }} +</div> diff --git a/themes/docsy/layouts/shortcodes/blocks/lead.html b/themes/docsy/layouts/shortcodes/blocks/lead.html new file mode 100644 index 0000000..f57ebb1 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/lead.html @@ -0,0 +1,12 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $col_id := .Get "color" | default .Ordinal }} +{{ $height := .Get "height" | default "auto" }} +{{/* Height can be one of: auto, min, med, max, full. */}} +<a id="td-block-{{ .Ordinal }}" class="td-offset-anchor"></a> +<section class="row td-box td-box--{{ $col_id }} position-relative td-box--gradient td-box--height-{{ $height }}"> + <div class="container text-center td-arrow-down"> + <span class="h4 mb-0"> + {{ .Inner | markdownify }} + </span> + </div> +</section> diff --git a/themes/docsy/layouts/shortcodes/blocks/link-down.html b/themes/docsy/layouts/shortcodes/blocks/link-down.html new file mode 100644 index 0000000..6395866 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/link-down.html @@ -0,0 +1,7 @@ +{{ with .Parent }} +{{ $id := $.Get "id" | default (printf "td-block-%d" ( add .Ordinal 1 )) }} +{{ $color := $.Get "color" | default "blue" }} +<a class="btn btn-link text-{{ $color }}" href="#{{ $id }}"><i class="fa fa-chevron-circle-down" style="font-size: 400%"></i></a> +{{ else }} +{{ errorf "The link-down shortcode is supposed to be nested inside a shortcode"}} +{{ end }}
\ No newline at end of file diff --git a/themes/docsy/layouts/shortcodes/blocks/section.html b/themes/docsy/layouts/shortcodes/blocks/section.html new file mode 100644 index 0000000..d5897f6 --- /dev/null +++ b/themes/docsy/layouts/shortcodes/blocks/section.html @@ -0,0 +1,12 @@ +{{ $_hugo_config := `{ "version": 1 }` }} +{{ $col_id := .Get "color" | default .Ordinal }} +{{ $height := .Get "height" | default "auto" }} +{{ $type := .Get "type" | default "" }} +<a id="td-block-{{ .Ordinal }}" class="td-offset-anchor"></a> +<section class="row td-box td-box--{{ $col_id }} td-box--gradient td-box--height-{{ $height }}"> + <div class="col"> + <div class="row {{ $type }}"> + {{ .Inner | markdownify}} + </div> + </div> +</section> |