diff --git a/exampleSite/content/blog/quote-shortcode.md b/exampleSite/content/blog/quote-shortcode.md index 3ee0b20b..0ed8cae6 100644 --- a/exampleSite/content/blog/quote-shortcode.md +++ b/exampleSite/content/blog/quote-shortcode.md @@ -24,6 +24,22 @@ Don't believe everything you read on the Internet. Code: +```go-text-template +{{}} +Don't believe everything you read on the Internet. +{{}} +``` + +Result: + +{{< paige/quote caption="Abraham Lincoln" >}} +Don't believe everything you read on the Internet. +{{< /paige/quote >}} + +--- + +Code: + ```go-text-template {{}} Don't believe everything you read on the Internet. diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html index 55254db0..b98755bb 100644 --- a/layouts/partials/paige/figure.html +++ b/layouts/partials/paige/figure.html @@ -1,6 +1,52 @@ {{ $caption := .caption | markdownify }} {{ $content := .content | markdownify }} {{ $float := .float }} +{{ $height := .height }} +{{ $maxheight := .maxheight }} +{{ $maxwidth := .maxwidth }} +{{ $width := .width }} + +{{ $style := "" }} + +{{ if $height }} + {{ with printf "height: %v" $height }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $maxheight }} + {{ with printf "max-height: %v" $maxheight }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $maxwidth }} + {{ with printf "max-width: %v" $maxwidth }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $width }} + {{ with printf "width: %v" $width }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} {{ $margins := "" }} {{ if $float }} @@ -13,9 +59,15 @@ {{ end }} {{ end }} -
+
+ {{ with $style }} +
+ {{ end }}
{{ $content }}
{{ with $caption }}
{{ . }}
{{ end }} + {{ if $style }} +
+ {{ end }}
diff --git a/layouts/partials/paige/image-figure.html b/layouts/partials/paige/image-figure.html index fe8ee059..03fb6d77 100644 --- a/layouts/partials/paige/image-figure.html +++ b/layouts/partials/paige/image-figure.html @@ -87,15 +87,15 @@ {{ end }}
{{ else if $float }} - {{ $margins := "" }} + {{ $margin := "" }} {{ if eq $float "start" }} - {{ $margins = "me-4" }} + {{ $margin = "me-4" }} {{ else if eq $float "end" }} - {{ $margins = "ms-4" }} + {{ $margin = "ms-4" }} {{ else }} {{ errorf "invalid float: %q" $float }} {{ end }} -
+
{{ $content }} {{ with $caption }}
{{ . }}
diff --git a/layouts/shortcodes/paige/figure.html b/layouts/shortcodes/paige/figure.html index 7a07bb40..4d36d129 100644 --- a/layouts/shortcodes/paige/figure.html +++ b/layouts/shortcodes/paige/figure.html @@ -1,5 +1,9 @@ {{ $caption := .Get 0 | default (.Get "caption") }} {{ $float := .Get "float" }} +{{ $height := .Get "height" }} +{{ $maxheight := .Get "maxheight" }} +{{ $maxwidth := .Get "maxwidth" }} +{{ $width := .Get "width" }} {{ $content := .Inner }} @@ -7,4 +11,8 @@ "caption" $caption "content" $content "float" $float + "height" $height + "maxheight" $maxheight + "maxwidth" $maxwidth + "width" $width ) }} diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index 0fd1fa42..142ceeb2 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -2,9 +2,55 @@ {{ $caption := .Get "caption" | markdownify }} {{ $cite := (.Get 0 | default (.Get "cite")) | markdownify }} {{ $float := .Get "float" }} +{{ $height := .Get "height" }} +{{ $maxheight := .Get "maxheight" }} +{{ $maxwidth := .Get "maxwidth" }} +{{ $width := .Get "width" }} {{ $content := .Inner | markdownify }} +{{ $style := "" }} + +{{ if $height }} + {{ with printf "height: %v" $height }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $maxheight }} + {{ with printf "max-height: %v" $maxheight }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $maxwidth }} + {{ with printf "max-width: %v" $maxwidth }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + +{{ if $width }} + {{ with printf "width: %v" $width }} + {{ if $style }} + {{ $style = printf "%v; %v" $style . }} + {{ else }} + {{ $style = . }} + {{ end }} + {{ end }} +{{ end }} + {{ $margins := "" }} {{ if $float }} {{ if eq $float "start" }} @@ -17,13 +63,17 @@ {{ end }}
-
-
{{ $content }}
- {{ with $caption }} -
{{ . }}
- {{ end }} - {{ with $cite }} - - {{ end }} -
+ {{ with $style }} +
+ {{ end }} +
{{ $content }}
+ {{ with $caption }} +
{{ . }}
+ {{ end }} + {{ with $cite }} + + {{ end }} + {{ if $style }} +
+ {{ end }}