Remove raw param
This commit is contained in:
@@ -315,7 +315,6 @@ paige:
|
|||||||
image:
|
image:
|
||||||
alt: "" # Image alt
|
alt: "" # Image alt
|
||||||
height: "" # CSS unit; image height
|
height: "" # CSS unit; image height
|
||||||
raw: false # Do not copy the file
|
|
||||||
stretch: false # Stretch the image fully horizontally if true; center the image otherwise
|
stretch: false # Stretch the image fully horizontally if true; center the image otherwise
|
||||||
url: "" # Local or remote resource glob
|
url: "" # Local or remote resource glob
|
||||||
width: "" # CSS unit; image width
|
width: "" # CSS unit; image width
|
||||||
@@ -456,7 +455,6 @@ The `paige/image` shortcode provides a figure with an image.
|
|||||||
maxwidth="10rem"
|
maxwidth="10rem"
|
||||||
method="resize"
|
method="resize"
|
||||||
options="550x webp picture Lanczos"
|
options="550x webp picture Lanczos"
|
||||||
raw=false
|
|
||||||
src="me.jpg"
|
src="me.jpg"
|
||||||
title="My title"
|
title="My title"
|
||||||
width="10rem"
|
width="10rem"
|
||||||
@@ -482,8 +480,6 @@ Parameters:
|
|||||||
<dd>Optional. String. Hugo image processing method. Must be <code>crop</code>, <code>fill</code>, <code>fit</code>, or <code>resize</code>. Must be specified with <code>options</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-methods">methods</a>.</dd>
|
<dd>Optional. String. Hugo image processing method. Must be <code>crop</code>, <code>fill</code>, <code>fit</code>, or <code>resize</code>. Must be specified with <code>options</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-methods">methods</a>.</dd>
|
||||||
<dt><code>options</code></dt>
|
<dt><code>options</code></dt>
|
||||||
<dd>Optional. String. Hugo image processing options. Must be specified with <code>method</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-options">options</a>.</dd>
|
<dd>Optional. String. Hugo image processing options. Must be specified with <code>method</code>. See the <a href="https://gohugo.io/content-management/image-processing/#image-processing-options">options</a>.</dd>
|
||||||
<dt><code>raw</code></dt>
|
|
||||||
<dd>Optional. Boolean. Whether to reference an image without copying it. Default is <code>false</code>.</dd>
|
|
||||||
<dt><code>src</code></dt>
|
<dt><code>src</code></dt>
|
||||||
<dd>Required. Position 0. String. URL. Image source.</dd>
|
<dd>Required. Position 0. String. URL. Image source.</dd>
|
||||||
<dt><code>title</code></dt>
|
<dt><code>title</code></dt>
|
||||||
|
@@ -8,7 +8,6 @@ paige:
|
|||||||
blurb: "This is the blurb."
|
blurb: "This is the blurb."
|
||||||
greeting: "This is the greeting"
|
greeting: "This is the greeting"
|
||||||
image:
|
image:
|
||||||
raw: false
|
|
||||||
stretch: false
|
stretch: false
|
||||||
url: "landscape.webp"
|
url: "landscape.webp"
|
||||||
main:
|
main:
|
||||||
@@ -126,7 +125,6 @@ paige:
|
|||||||
blurb: "This is the blurb."
|
blurb: "This is the blurb."
|
||||||
greeting: "This is the greeting"
|
greeting: "This is the greeting"
|
||||||
image:
|
image:
|
||||||
raw: false
|
|
||||||
stretch: false
|
stretch: false
|
||||||
url: "landscape.webp"
|
url: "landscape.webp"
|
||||||
main:
|
main:
|
||||||
|
@@ -83,30 +83,6 @@ Result:
|
|||||||
|
|
||||||
{{< paige/image link="https://github.com/willfaught/paige" method="resize" options="550x webp picture Lanczos" src="landscape.webp" >}}
|
{{< paige/image link="https://github.com/willfaught/paige" method="resize" options="550x webp picture Lanczos" src="landscape.webp" >}}
|
||||||
|
|
||||||
## Raw parameter
|
|
||||||
|
|
||||||
Code:
|
|
||||||
|
|
||||||
```go-text-template
|
|
||||||
{{</* paige/image raw=false src="https://picsum.photos/1296/600.webp" */>}}
|
|
||||||
```
|
|
||||||
|
|
||||||
Result:
|
|
||||||
|
|
||||||
{{< paige/image raw=false src="https://picsum.photos/1296/600.webp" >}}
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Code:
|
|
||||||
|
|
||||||
```go-text-template
|
|
||||||
{{</* paige/image raw=true src="https://picsum.photos/1296/600.webp" */>}}
|
|
||||||
```
|
|
||||||
|
|
||||||
Result:
|
|
||||||
|
|
||||||
{{< paige/image raw=true src="https://picsum.photos/1296/600.webp" >}}
|
|
||||||
|
|
||||||
## Src parameter
|
## Src parameter
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
|
@@ -22,7 +22,6 @@
|
|||||||
"fetchpriority" "high"
|
"fetchpriority" "high"
|
||||||
"loading" "eager"
|
"loading" "eager"
|
||||||
"page" $page
|
"page" $page
|
||||||
"raw" $page.Params.paige.home.image.raw
|
|
||||||
"src" $page.Params.paige.home.image.url
|
"src" $page.Params.paige.home.image.url
|
||||||
"style" $style
|
"style" $style
|
||||||
) }}
|
) }}
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
{{ $method := $params.method }}
|
{{ $method := $params.method }}
|
||||||
{{ $options := $params.options }}
|
{{ $options := $params.options }}
|
||||||
{{ $page := $params.page }}
|
{{ $page := $params.page }}
|
||||||
{{ $raw := $params.raw }}
|
|
||||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||||
{{ $resource := $params.resource }}
|
{{ $resource := $params.resource }}
|
||||||
{{ $src := $params.src }}
|
{{ $src := $params.src }}
|
||||||
@@ -27,16 +26,14 @@
|
|||||||
{{ $intrinsicheight := $height }}
|
{{ $intrinsicheight := $height }}
|
||||||
{{ $intrinsicwidth := $width }}
|
{{ $intrinsicwidth := $width }}
|
||||||
|
|
||||||
{{ if $raw }}
|
{{ if not $resource }}
|
||||||
{{ $src = relLangURL $src }}
|
{{ $resource = partial "paige/resource.html" (dict
|
||||||
{{ else }}
|
"page" $page
|
||||||
{{ if not $resource }}
|
"url" $src
|
||||||
{{ $resource = partial "paige/resource.html" (dict
|
) }}
|
||||||
"page" $page
|
{{ end }}
|
||||||
"url" $src
|
|
||||||
) }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
|
{{ with $resource }}
|
||||||
{{ if and $method $options }}
|
{{ if and $method $options }}
|
||||||
{{ if eq $method "crop" }}
|
{{ if eq $method "crop" }}
|
||||||
{{ $resource = $resource.Crop $options }}
|
{{ $resource = $resource.Crop $options }}
|
||||||
@@ -59,6 +56,8 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $src = $resource.RelPermalink }}
|
{{ $src = $resource.RelPermalink }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $src = relLangURL $src }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if and (or $height $maxheight) (not (or $maxwidth $width)) }}
|
{{ if and (or $height $maxheight) (not (or $maxwidth $width)) }}
|
||||||
|
@@ -7,7 +7,6 @@
|
|||||||
{{ $integrity := $params.integrity }}
|
{{ $integrity := $params.integrity }}
|
||||||
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
|
{{ $outputstyle := cond hugo.IsProduction "compressed" "" }}
|
||||||
{{ $page := $params.page }}
|
{{ $page := $params.page }}
|
||||||
{{ $raw := $params.raw }}
|
|
||||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||||
{{ $sass := $params.sass }}
|
{{ $sass := $params.sass }}
|
||||||
|
|
||||||
@@ -15,13 +14,8 @@
|
|||||||
{{ errorf "paige/link: no href" }}
|
{{ errorf "paige/link: no href" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if not $raw }}
|
{{ with partial "paige/resource.html" (dict "page" $page "url" $href) }}
|
||||||
{{ $resource := partial "paige/resource.html" (dict
|
{{ $resource := resources.ExecuteAsTemplate $href (or $page dict) . }}
|
||||||
"page" $page
|
|
||||||
"url" $href
|
|
||||||
) }}
|
|
||||||
|
|
||||||
{{ $resource = resources.ExecuteAsTemplate $href (or $page dict) $resource }}
|
|
||||||
|
|
||||||
{{ if $sass }}
|
{{ if $sass }}
|
||||||
{{ $resource = $resource | toCSS (dict
|
{{ $resource = $resource | toCSS (dict
|
||||||
@@ -34,6 +28,8 @@
|
|||||||
{{ $resource = $resource | minify | fingerprint }}
|
{{ $resource = $resource | minify | fingerprint }}
|
||||||
{{ $href = $resource.RelPermalink }}
|
{{ $href = $resource.RelPermalink }}
|
||||||
{{ $integrity = $resource.Data.Integrity }}
|
{{ $integrity = $resource.Data.Integrity }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $href = relLangURL $href }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<link {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} href="{{ $href | safeURL }}" {{ with $integrity }} integrity="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} rel="stylesheet">
|
<link {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} href="{{ $href | safeURL }}" {{ with $integrity }} integrity="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} rel="stylesheet">
|
||||||
|
@@ -35,8 +35,4 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if not $result }}
|
|
||||||
{{ errorf "paige/resource: invalid resource: %q" $url }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ return $result }}
|
{{ return $result }}
|
||||||
|
@@ -6,23 +6,18 @@
|
|||||||
{{ $onload := $params.onload | safeJS }}
|
{{ $onload := $params.onload | safeJS }}
|
||||||
{{ $page := $params.page }}
|
{{ $page := $params.page }}
|
||||||
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
{{ $referrerpolicy := $params.referrerpolicy | default "no-referrer" }}
|
||||||
{{ $raw := $params.raw }}
|
|
||||||
{{ $src := $params.src }}
|
{{ $src := $params.src }}
|
||||||
|
|
||||||
{{ if not $src }}
|
{{ if not $src }}
|
||||||
{{ errorf "paige/script: no src" }}
|
{{ errorf "paige/script: no src" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if $raw }}
|
{{ with partial "paige/resource.html" (dict "page" $page "url" $src) }}
|
||||||
{{ $src = $src }}
|
{{ $resource := . | minify | fingerprint }}
|
||||||
{{ else }}
|
|
||||||
{{ $resource := (partial "paige/resource.html" (dict
|
|
||||||
"page" $page
|
|
||||||
"url" $src
|
|
||||||
)) | minify | fingerprint }}
|
|
||||||
|
|
||||||
{{ $integrity = $resource.Data.Integrity }}
|
{{ $integrity = $resource.Data.Integrity }}
|
||||||
{{ $src = $resource.RelPermalink }}
|
{{ $src = $resource.RelPermalink }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $href = relLangURL $href }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<script {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src | safeURL }}"></script>
|
<script {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $defer }} defer {{ end }} integrity="{{ $integrity }}" {{ with $onload }} onload="{{ . }}" {{ end }} {{ with $referrerpolicy }} referrerpolicy="{{ . }}" {{ end }} src="{{ $src | safeURL }}"></script>
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
{{ $method := .Get "method" }}
|
{{ $method := .Get "method" }}
|
||||||
{{ $options := .Get "options" }}
|
{{ $options := .Get "options" }}
|
||||||
{{ $raw := .Get "raw" }}
|
|
||||||
{{ $src := .Get 0 | default (.Get "src") }}
|
{{ $src := .Get 0 | default (.Get "src") }}
|
||||||
{{ $title := .Get "title" }}
|
{{ $title := .Get "title" }}
|
||||||
{{ $width := .Get "width" }}
|
{{ $width := .Get "width" }}
|
||||||
@@ -23,7 +22,6 @@
|
|||||||
"method" $method
|
"method" $method
|
||||||
"options" $options
|
"options" $options
|
||||||
"page" .Page
|
"page" .Page
|
||||||
"raw" $raw
|
|
||||||
"src" $src
|
"src" $src
|
||||||
"title" $title
|
"title" $title
|
||||||
"width" $width
|
"width" $width
|
||||||
|
Reference in New Issue
Block a user