mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-07 18:14:28 +00:00
Compare commits
14 Commits
v0.24.0-be
...
v0.24.0-be
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8d9f12d676 | ||
![]() |
1a89aa39c2 | ||
![]() |
6b60188702 | ||
![]() |
5e410040cc | ||
![]() |
b00f39f850 | ||
![]() |
7e396c5a4d | ||
![]() |
4d43f0bb9b | ||
![]() |
3512bb9dfe | ||
![]() |
7dde897e41 | ||
![]() |
f2cad0fe88 | ||
![]() |
eed2d8f68d | ||
![]() |
d1aebe2fbe | ||
![]() |
013614b149 | ||
![]() |
d55446d5cc |
@@ -19,7 +19,9 @@ comment: >-
|
|||||||
reference.
|
reference.
|
||||||
arguments:
|
arguments:
|
||||||
url:
|
url:
|
||||||
type: string
|
type:
|
||||||
|
- string
|
||||||
|
- template.URL
|
||||||
optional: true
|
optional: true
|
||||||
comment: >-
|
comment: >-
|
||||||
Path or url of the image, e.g. `img/example.jpg`. Images with multiple
|
Path or url of the image, e.g. `img/example.jpg`. Images with multiple
|
||||||
@@ -128,3 +130,11 @@ arguments:
|
|||||||
optional: true
|
optional: true
|
||||||
comment: Class attribute of the figure caption, e.g. `px-4`.
|
comment: Class attribute of the figure caption, e.g. `px-4`.
|
||||||
release: v0.23.0
|
release: v0.23.0
|
||||||
|
plain:
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
|
optional: true
|
||||||
|
comment:
|
||||||
|
Flag to indicate if the image should render a plain image instead of an
|
||||||
|
image set. When set, no transformations are applied to the image.
|
||||||
|
release: v0.24.0-beta5
|
||||||
|
@@ -15,7 +15,7 @@ As an example, the following shortcode displays an image with rounded corners an
|
|||||||
<!-- markdownlint-disable MD037 -->
|
<!-- markdownlint-disable MD037 -->
|
||||||
{{< example lang="hugo" >}}
|
{{< example lang="hugo" >}}
|
||||||
{{</* image src="https://res.cloudinary.com/demo/image/upload/dog.webp"
|
{{</* image src="https://res.cloudinary.com/demo/image/upload/dog.webp"
|
||||||
ratio="21x9" caption="Cloudinary image" class="rounded" */>}}
|
ratio="21x9" caption="Cloudinary image" class="rounded" plain=true */>}}
|
||||||
{{< /example >}}
|
{{< /example >}}
|
||||||
<!-- markdownlint-enable MD037 -->
|
<!-- markdownlint-enable MD037 -->
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
|||||||
github.com/gethinode/mod-katex v1.1.0 // indirect
|
github.com/gethinode/mod-katex v1.1.0 // indirect
|
||||||
github.com/gethinode/mod-leaflet v1.1.0 // indirect
|
github.com/gethinode/mod-leaflet v1.1.0 // indirect
|
||||||
github.com/gethinode/mod-lottie v1.5.0 // indirect
|
github.com/gethinode/mod-lottie v1.5.0 // indirect
|
||||||
github.com/gethinode/mod-utils/v2 v2.3.1 // indirect
|
github.com/gethinode/mod-utils/v2 v2.3.3 // indirect
|
||||||
github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect
|
github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect
|
||||||
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
|
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@@ -202,6 +202,10 @@ github.com/gethinode/mod-utils/v2 v2.3.0 h1:e3uhlAGasvXe+cgvcmzRe05Zo4UEx86uk0Tb
|
|||||||
github.com/gethinode/mod-utils/v2 v2.3.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
github.com/gethinode/mod-utils/v2 v2.3.0/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||||
github.com/gethinode/mod-utils/v2 v2.3.1 h1:blqynoRJ+H2SPfSU28iYheYWPH39MKNtK5HKJPghL3M=
|
github.com/gethinode/mod-utils/v2 v2.3.1 h1:blqynoRJ+H2SPfSU28iYheYWPH39MKNtK5HKJPghL3M=
|
||||||
github.com/gethinode/mod-utils/v2 v2.3.1/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
github.com/gethinode/mod-utils/v2 v2.3.1/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||||
|
github.com/gethinode/mod-utils/v2 v2.3.2 h1:QxYtHqeiLfAg+38ULFr3qYwNuypcnV1KzsmmNUjbX+U=
|
||||||
|
github.com/gethinode/mod-utils/v2 v2.3.2/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||||
|
github.com/gethinode/mod-utils/v2 v2.3.3 h1:dewgQgAyPJJ1lA2WhowHaFqVaeLjUNYgxDO4mE3v0F0=
|
||||||
|
github.com/gethinode/mod-utils/v2 v2.3.3/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
|
||||||
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo=
|
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo=
|
||||||
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU=
|
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU=
|
||||||
github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=
|
github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=
|
||||||
|
@@ -14,13 +14,13 @@
|
|||||||
{{- $url := .url -}}
|
{{- $url := .url -}}
|
||||||
{{- $mode := .mode -}}
|
{{- $mode := .mode -}}
|
||||||
{{- $modes := .modes -}}
|
{{- $modes := .modes -}}
|
||||||
|
{{- $plain := .plain | default false }}
|
||||||
|
|
||||||
{{- $fallbackURL := "" -}}
|
{{- $fallbackURL := "" -}}
|
||||||
{{- $anchor := "" -}}
|
{{- $anchor := "" -}}
|
||||||
{{- $imgset := "" -}}
|
{{- $imgset := "" -}}
|
||||||
{{- $isVector := false -}}
|
{{- $isVector := false -}}
|
||||||
|
|
||||||
|
|
||||||
<!-- Split url into base and anchor when applicable (only relevant for vector images) -->
|
<!-- Split url into base and anchor when applicable (only relevant for vector images) -->
|
||||||
{{- $segments := split $url "#" -}}
|
{{- $segments := split $url "#" -}}
|
||||||
{{- if gt (len $segments) 2 -}}
|
{{- if gt (len $segments) 2 -}}
|
||||||
@@ -65,29 +65,31 @@
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $transform = "fit" }}
|
{{ $transform = "fit" }}
|
||||||
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
|
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
|
||||||
{{ with $res }}
|
{{ if and $res $res.resource }}
|
||||||
{{ $img = $res.resource }}
|
{{ $img = $res.resource }}
|
||||||
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
|
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
|
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
|
||||||
{{ range $width := $widths -}}
|
{{ range $width := $widths -}}
|
||||||
{{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
|
{{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<!-- Derive image width and height -->
|
<!-- Derive image width and height -->
|
||||||
{{ $width := "" }}
|
{{ $width := "" }}
|
||||||
{{ $height := "" }}
|
{{ $height := "" }}
|
||||||
{{ with $dims }}
|
{{ if not $plain }}
|
||||||
{{ range $dim := (. | last 1) }}
|
{{ with $dims }}
|
||||||
{{ $width = (int (index (split $dim "x") 0)) }}
|
{{ range $dim := (. | last 1) }}
|
||||||
{{ $height = (int (index (split $dim "x") 1)) }}
|
{{ $width = (int (index (split $dim "x") 0)) }}
|
||||||
|
{{ $height = (int (index (split $dim "x") 1)) }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<!-- Generate image urls -->
|
<!-- Generate image urls -->
|
||||||
{{ if hasSuffix $url "svg" }}
|
{{ if or (hasSuffix $url "svg") $plain }}
|
||||||
{{- $fallbackURL = $url -}}
|
{{- $fallbackURL = $url -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{- $fallbackURL = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" ($dims | last 1) "transform" $transform "hook" $hook "format" "jpg" "includeWidth" false) -}}
|
{{- $fallbackURL = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" ($dims | last 1) "transform" $transform "hook" $hook "format" "jpg" "includeWidth" false) -}}
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
{{- $priority := .priority -}}
|
{{- $priority := .priority -}}
|
||||||
{{- if eq $priority "auto" }}{{ $priority = "" }}{{ end -}}
|
{{- if eq $priority "auto" }}{{ $priority = "" }}{{ end -}}
|
||||||
{{- $sizes := .sizes | default "100vw" -}}
|
{{- $sizes := .sizes | default "100vw" -}}
|
||||||
|
{{- $plain := .plain | default false -}}
|
||||||
|
|
||||||
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
|
{{- $absoluteURL := site.Params.main.canonifyAssetsURLs | default false -}}
|
||||||
{{- $url := .url -}}
|
{{- $url := .url -}}
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
"priority" $priority
|
"priority" $priority
|
||||||
"sizes" $sizes
|
"sizes" $sizes
|
||||||
"absoluteURL" $absoluteURL
|
"absoluteURL" $absoluteURL
|
||||||
|
"plain" $plain
|
||||||
)
|
)
|
||||||
-}}
|
-}}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
{{- $portrait := false -}}
|
{{- $portrait := false -}}
|
||||||
{{- $loading := "" -}}
|
{{- $loading := "" -}}
|
||||||
{{- $error := false -}}
|
{{- $error := false -}}
|
||||||
|
{{- $plain := false -}}
|
||||||
|
|
||||||
{{- if .IsNamedParams -}}
|
{{- if .IsNamedParams -}}
|
||||||
{{ $url = .Get "src" | default "" -}}
|
{{ $url = .Get "src" | default "" -}}
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
{{ $figclass = .Get "figclass" | default "" -}}
|
{{ $figclass = .Get "figclass" | default "" -}}
|
||||||
{{ with .Get "mode" }}{{ $mode = partial "utilities/CastBool.html" . }}{{ end -}}
|
{{ with .Get "mode" }}{{ $mode = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||||
{{ with .Get "portrait" }}{{ $portrait = partial "utilities/CastBool.html" . }}{{ end -}}
|
{{ with .Get "portrait" }}{{ $portrait = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||||
|
{{ with .Get "plain" }}{{ $plain = partial "utilities/CastBool.html" . }}{{ end -}}
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{ $url = .Get 0 }}
|
{{ $url = .Get 0 }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
@@ -58,6 +60,7 @@
|
|||||||
"figclass" $figclass
|
"figclass" $figclass
|
||||||
"mode" $mode
|
"mode" $mode
|
||||||
"portrait" $portrait
|
"portrait" $portrait
|
||||||
|
"plain" $plain
|
||||||
"loading" $loading
|
"loading" $loading
|
||||||
"page" .Page)
|
"page" .Page)
|
||||||
-}}
|
-}}
|
||||||
|
17
package-lock.json
generated
17
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.24.0-beta3",
|
"version": "0.24.0-beta5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.24.0-beta3",
|
"version": "0.24.0-beta5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fullhuman/postcss-purgecss": "^6.0.0",
|
"@fullhuman/postcss-purgecss": "^6.0.0",
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"eslint-config-standard": "^17.1.0",
|
"eslint-config-standard": "^17.1.0",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-n": "^16.6.2",
|
"eslint-plugin-n": "^16.6.2",
|
||||||
"eslint-plugin-promise": "^6.1.1",
|
"eslint-plugin-promise": "^6.2.0",
|
||||||
"hugo-bin": "0.123.1",
|
"hugo-bin": "0.123.1",
|
||||||
"markdownlint-cli2": "^0.13.0",
|
"markdownlint-cli2": "^0.13.0",
|
||||||
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
||||||
@@ -3067,15 +3067,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-promise": {
|
"node_modules/eslint-plugin-promise": {
|
||||||
"version": "6.1.1",
|
"version": "6.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.2.0.tgz",
|
||||||
"integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==",
|
"integrity": "sha512-QmAqwizauvnKOlifxyDj2ObfULpHQawlg/zQdgEixur9vl0CvZGv/LCJV2rtj3210QCoeGBzVMfMXqGAOr/4fA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
},
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://opencollective.com/eslint"
|
||||||
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^7.0.0 || ^8.0.0"
|
"eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gethinode/hinode",
|
"name": "@gethinode/hinode",
|
||||||
"version": "0.24.0-beta3",
|
"version": "0.24.0-beta5",
|
||||||
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hugo",
|
"hugo",
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
"eslint-config-standard": "^17.1.0",
|
"eslint-config-standard": "^17.1.0",
|
||||||
"eslint-plugin-import": "^2.29.1",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-n": "^16.6.2",
|
"eslint-plugin-n": "^16.6.2",
|
||||||
"eslint-plugin-promise": "^6.1.1",
|
"eslint-plugin-promise": "^6.2.0",
|
||||||
"hugo-bin": "0.123.1",
|
"hugo-bin": "0.123.1",
|
||||||
"markdownlint-cli2": "^0.13.0",
|
"markdownlint-cli2": "^0.13.0",
|
||||||
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
"netlify-plugin-hugo-cache-resources": "^0.2.1",
|
||||||
|
Reference in New Issue
Block a user