Add gallery param process

master
Will Faught 2 years ago
parent e5351c6268
commit 17abad4523

@ -429,14 +429,12 @@ The `paige/gallery` shortcode provides a figure with a collection of images.
``` ```
{{< paige/gallery {{< paige/gallery
align="" align=""
format=""
height="" height=""
images="" images=""
justify="" justify=""
maxheight="" maxheight=""
maxwidth="" maxwidth=""
method="" process=""
options=""
type="" type=""
width="" >}} width="" >}}
@ -450,8 +448,6 @@ Parameters:
<dl> <dl>
<dt><code>align</code></dt> <dt><code>align</code></dt>
<dd>Optional. String. Cross axis alignment. Must be <code>baseline</code>, <code>center</code>, <code>end</code>, <code>start</code>, or <code>stretch</code>.</dd> <dd>Optional. String. Cross axis alignment. Must be <code>baseline</code>, <code>center</code>, <code>end</code>, <code>start</code>, or <code>stretch</code>.</dd>
<dt><code>format</code></dt>
<dd>Optional. String. Image format. Must be <code>bmp</code>, <code>gif</code>, <code>jpg</code>, <code>png</code>, <code>tiff</code>, or <code>webp</code>. Must not be used with <code>method</code> or <code>options</code>.</dd>
<dt><code>height</code></dt> <dt><code>height</code></dt>
<dd>Optional. String. CSS value. Image height.</dd> <dd>Optional. String. CSS value. Image height.</dd>
<dt><code>images</code></dt> <dt><code>images</code></dt>
@ -462,10 +458,8 @@ Parameters:
<dd>Optional. String. CSS value. Maximum image height.</dd> <dd>Optional. String. CSS value. Maximum image height.</dd>
<dt><code>maxwidth</code></dt> <dt><code>maxwidth</code></dt>
<dd>Optional. String. CSS value. Maximum image width.</dd> <dd>Optional. String. CSS value. Maximum image width.</dd>
<dt><code>method</code></dt> <dt><code>process</code></dt>
<dd>Optional. String. Hugo image processing method. Must be <code>crop</code>, <code>fill</code>, <code>fit</code>, or <code>resize</code>. Default is <code>resize</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-methods">methods</a>.</dd> <dd>Optional. String or boolean. If a string, it is the Hugo image processing <a href="https://gohugo.io/content-management/image-processing/#image-processing-methods">methods</a> and <a href="https://gohugo.io/content-management/image-processing/#image-processing-options">options</a>, mixed together. If no method is specified, resize is used. If no image dimensions are given, the originals are used. If a boolean that is true, the Hugo image processing method resize is used, and the default Hugo image processing options are used.</dd>
<dt><code>options</code></dt>
<dd>Optional. String. Hugo image processing options. Default is <code>550x webp picture Lanczos</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-options">options</a>.</dd>
<dt><code>type</code></dt> <dt><code>type</code></dt>
<dd>Optional. String. Type of layout. Grid and list layouts use the horizontal axis as the main axis, and the vertical axis as the cross axis. Must be <code>grid</code> or <code>list</code>. Default is <code>list</code>.</dd> <dd>Optional. String. Type of layout. Grid and list layouts use the horizontal axis as the main axis, and the vertical axis as the cross axis. Must be <code>grid</code> or <code>list</code>. Default is <code>list</code>.</dd>
<dt><code>width</code></dt> <dt><code>width</code></dt>

@ -197,17 +197,17 @@ Result:
{{< paige/gallery images="*-2.jpg" maxwidth="20rem" />}} {{< paige/gallery images="*-2.jpg" maxwidth="20rem" />}}
## Method and options parameters ## Process parameter
Code: Code:
```go-text-template ```go-text-template
{{</* paige/gallery images="*-2.jpg" method="fill" options="550x550 r90 webp picture Lanczos" /*/>}} {{</* paige/gallery images="*-2.jpg" process="300x300 center crop lanczos picture r90 webp" /*/>}}
``` ```
Result: Result:
{{< paige/gallery images="*-2.jpg" method="fill" options="550x550 r90 webp picture Lanczos" />}} {{< paige/gallery images="*-2.jpg" process="300x300 center crop lanczos picture r90 webp" />}}
## Type ## Type

@ -1,12 +1,10 @@
{{ $align := .Get "align" | default "center" }} {{ $align := .Get "align" | default "center" }}
{{ $format := .Get "format" }}
{{ $height := .Get "height" }} {{ $height := .Get "height" }}
{{ $images := .Get 0 | default (.Get "images") }} {{ $images := .Get 0 | default (.Get "images") }}
{{ $justify := .Get "justify" | default "center" }} {{ $justify := .Get "justify" | default "center" }}
{{ $maxheight := .Get "maxheight" }} {{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }} {{ $maxwidth := .Get "maxwidth" }}
{{ $method := .Get "method" | default "resize" }} {{ $process := .Get "process" }}
{{ $options := .Get "options" | default "550x webp picture Lanczos" }}
{{ $type := .Get "type" | default "rows" }} {{ $type := .Get "type" | default "rows" }}
{{ $width := .Get "width" }} {{ $width := .Get "width" }}
@ -45,12 +43,10 @@
{{ partial "paige/a.html" (dict {{ partial "paige/a.html" (dict
"content" (partial "paige/img.html" (dict "content" (partial "paige/img.html" (dict
"class" "img-fluid" "class" "img-fluid"
"format" $format
"height" $height "height" $height
"maxheight" $maxheight "maxheight" $maxheight
"maxwidth" $maxwidth "maxwidth" $maxwidth
"method" $method "process" $process
"options" $options
"resource" . "resource" .
"width" $width "width" $width
)) ))
@ -70,12 +66,10 @@
{{ partial "paige/a.html" (dict {{ partial "paige/a.html" (dict
"content" (partial "paige/img.html" (dict "content" (partial "paige/img.html" (dict
"class" "img-fluid" "class" "img-fluid"
"format" $format
"height" $height "height" $height
"maxheight" $maxheight "maxheight" $maxheight
"maxwidth" $maxwidth "maxwidth" $maxwidth
"method" $method "process" $process
"options" $options
"resource" . "resource" .
"width" $width "width" $width
)) ))

Loading…
Cancel
Save