-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BSv5] blocks/cover row/col fix (#1467)
- Loading branch information
Showing
4 changed files
with
40 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
} | ||
|
||
& > .byline { | ||
@extend .small; | ||
position: absolute; | ||
bottom: 2px; | ||
right: 4px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
{{ $_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" }} | ||
{{ $byline := .Get "byline" | default "" }} | ||
{{ with $promo_image }} | ||
{{ $promo_image_big := (.Fill (printf "1920x1080 %s" $image_anchor)) }} | ||
{{ $promo_image_small := (.Fill (printf "960x540 %s" $image_anchor)) }} | ||
{{ $_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 }}); | ||
background-image: url({{ $promo_image_small.RelPermalink }}); | ||
} | ||
@media only screen and (min-width: 1200px) { | ||
#{{ $blockID }} { | ||
background-image: url({{ $promo_image_big.RelPermalink }}); | ||
} | ||
#{{ $blockID }} { | ||
background-image: url({{ $promo_image_big.RelPermalink }}); | ||
} | ||
} | ||
</style> | ||
{{ end }} | ||
<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 }}"> | ||
<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"> | ||
{{ if eq .Page.File.Ext "md" }} | ||
{{ .Inner | markdownify }} | ||
{{ else }} | ||
{{ .Inner | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
</div> | ||
{{ end -}} | ||
|
||
<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 }}"> | ||
<div class="col-12 p-0"> | ||
<div class="container td-overlay__inner"> | ||
<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"> | ||
{{ if eq .Page.File.Ext "md" }} | ||
{{ .Inner | markdownify }} | ||
{{ else }} | ||
{{ .Inner | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{ if $byline }} | ||
<div class="byline"> | ||
<small>{{ $byline }}</small> | ||
</div> | ||
{{ end }} | ||
{{ with .Get "byline" | default "" -}} | ||
<div class="byline">{{ . }}</div> | ||
{{- end }} | ||
</section> | ||
{{/**/ -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters