Fail if no content for all shortcodes

master
Will Faught 2 years ago
parent 22ce6fb1fc
commit 754926f6c0

@ -1,4 +1,9 @@
{{ $content := .Inner | replaceRE "^\n" "" }}
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
{{ $options := .Get "options" }}
<div class="paige-code">{{ highlight (.Inner | replaceRE "^\n" "") $lang $options }}</div>
{{ if not $content }}
{{ errorf "paige/code: no content" }}
{{ end }}
<div class="paige-code">{{ highlight $content $lang $options }}</div>

@ -8,6 +8,10 @@
{{ $vertical := .Get "vertical" | default "center" }}
{{ $width := .Get "width" }}
{{ if not $content }}
{{ errorf "paige/figure: no content" }}
{{ end }}
{{ $showcaption := $caption }}
{{ $sidemargin := "" }}
{{ $table := false }}

@ -13,7 +13,7 @@
{{ $resources := slice }}
{{ if and (not $images) (not $inner) }}
{{ errorf "paige/gallery: no content specified" }}
{{ errorf "paige/gallery: no content" }}
{{ end }}
{{ if not $inner }}

@ -11,7 +11,7 @@
{{ $width := .Get "width" }}
{{ if not $src }}
{{ errorf "paige/image: invalid src: %q" $src }}
{{ errorf "paige/image: no content" }}
{{ end }}
{{ $content := partial "paige/img.html" (dict

@ -1,5 +1,9 @@
{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }}
{{ if not $content }}
{{ errorf "paige/quote: no content" }}
{{ end }}
<div class="paige-quote">
<blockquote class="blockquote">{{ $content }}</blockquote>
</div>

@ -26,6 +26,10 @@
{{ $video := .Get 0 | default (.Get "video") }}
{{ $width := .Get "width" }}
{{ if not $video }}
{{ errorf "paige/vimeo: no video" }}
{{ end }}
{{ $params := slice }}
{{ if not $autopause }}

@ -14,6 +14,10 @@
{{ $video := .Get 0 | default (.Get "video") | default "dQw4w9WgXcQ" }}
{{ $width := .Get "width" }}
{{ if not $video }}
{{ errorf "paige/youtube: no video" }}
{{ end }}
{{ $host := cond site.Config.Privacy.YouTube.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" }}
{{ $path := "" }}

Loading…
Cancel
Save