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
20 additions
and
17 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. */ -}} | ||
{{ 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--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