-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shortcode 'blocks/lead' improvements (#1398)
- Loading branch information
Showing
3 changed files
with
43 additions
and
38 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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{{ $_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> | ||
{{ with .Get "height" -}} | ||
{{ if not ( or ( eq . "auto" ) ( eq . "min" ) ( eq . "med" ) ( eq . "max" ) ( eq . "full" ) ) -}} | ||
{{ errorf "shortcode 'lead': parameter height is '%s', must be one of 'auto', 'min', 'med', 'max' or 'full'." . -}} | ||
{{ end -}} | ||
{{ end -}} | ||
<div><a id="td-block-{{ .Ordinal }}" class="td-offset-anchor"></a></div> | ||
<section class="row td-box td-box--{{ $col_id }} position-relative td-box--height-{{ $height }}"> | ||
<div class="container text-center td-arrow-down"> | ||
<div class="h4 mb-0"> | ||
{{ if eq .Page.File.Ext "md" -}} | ||
{{ .Inner | markdownify -}} | ||
{{ else -}} | ||
{{ .Inner | htmlUnescape | safeHTML -}} | ||
{{ end -}} | ||
</div> | ||
</div> | ||
<div class="container text-center td-arrow-down"> | ||
<div class="h4 mb-0"> | ||
{{/* Do NOT remove this comment! It ends above HTML block. See https://spec.commonmark.org/0.30/#html-blocks, 7. */}} | ||
{{ .Inner }} | ||
</div> | ||
</div> | ||
</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