forked from google/docsy
-
Notifications
You must be signed in to change notification settings - Fork 1
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':lead: improvements
- use Hugo's native support for processing HTML & markdown (google#906) - drop support for pre-Hugo-0.54.x behavior of {{% %}} google#939
- Loading branch information
Showing
3 changed files
with
22 additions
and
20 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. */}} | ||
{{ $col_id := .Get "color" | default .Ordinal -}} | ||
{{ $height := .Get "height" | default "auto" -}} | ||
{{/* Check: height must be one of: auto, min, med, max, full. */ -}} | ||
{{ 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 -}} | ||
<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"> | ||
<div class="h4 mb-0"> | ||
{{ if eq .Page.File.Ext "md" }} | ||
{{ .Inner | markdownify }} | ||
{{ else }} | ||
{{ .Inner | htmlUnescape | safeHTML }} | ||
{{ end }} | ||
</div> | ||
</div> | ||
<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"> | ||
<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