mirror of https://github.com/jpanther/congo.git
Compare commits
8 Commits
955e44e6d6
...
4754d31893
Author | SHA1 | Date |
---|---|---|
stereobooster | 4754d31893 | |
James Panther | 05c3fef94a | |
stereobooster | 954fd7fac9 | |
stereobooster | 06195bc379 | |
James Panther | 6e4ace75f8 | |
stereobooster | b592a81d46 | |
stereobooster | 6f0d70ee36 | |
stereobooster | 3ef388f4f6 |
|
@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.7.6] - 2023-11-26
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Some Mermaid diagram elements not styled correctly in dark mode ([#706](https://github.com/jpanther/congo/issues/706))
|
||||||
|
|
||||||
## [2.7.5] - 2023-11-25
|
## [2.7.5] - 2023-11-25
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -797,7 +803,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
- Advanced customisation using simple Tailwind colour definitions and styles
|
- Advanced customisation using simple Tailwind colour definitions and styles
|
||||||
- Fully documented
|
- Fully documented
|
||||||
|
|
||||||
[Unreleased]: https://github.com/jpanther/congo/compare/v2.7.5...HEAD
|
[Unreleased]: https://github.com/jpanther/congo/compare/v2.7.6...HEAD
|
||||||
|
[2.7.6]: https://github.com/jpanther/congo/compare/v2.7.5...v2.7.6
|
||||||
[2.7.5]: https://github.com/jpanther/congo/compare/v2.7.4...v2.7.5
|
[2.7.5]: https://github.com/jpanther/congo/compare/v2.7.4...v2.7.5
|
||||||
[2.7.4]: https://github.com/jpanther/congo/compare/v2.7.3...v2.7.4
|
[2.7.4]: https://github.com/jpanther/congo/compare/v2.7.3...v2.7.4
|
||||||
[2.7.3]: https://github.com/jpanther/congo/compare/v2.7.2...v2.7.3
|
[2.7.3]: https://github.com/jpanther/congo/compare/v2.7.2...v2.7.3
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*! Congo v2.7.5 | MIT License | https://github.com/jpanther/congo */
|
/*! Congo v2.7.6 | MIT License | https://github.com/jpanther/congo */
|
||||||
|
|
||||||
/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com */
|
/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com */
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*! Congo v2.7.5 | MIT License | https://github.com/jpanther/congo */
|
/*! Congo v2.7.6 | MIT License | https://github.com/jpanther/congo */
|
||||||
|
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
|
|
|
@ -2,19 +2,29 @@ function css(name) {
|
||||||
return "rgb(" + getComputedStyle(document.documentElement).getPropertyValue(name) + ")";
|
return "rgb(" + getComputedStyle(document.documentElement).getPropertyValue(name) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isDark = document.documentElement.classList.contains("dark");
|
||||||
|
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: "base",
|
theme: "base",
|
||||||
themeVariables: {
|
themeVariables: {
|
||||||
background: css("--color-neutral"),
|
background: css("--color-neutral"),
|
||||||
primaryColor: css("--color-primary-200"),
|
primaryTextColor: isDark ? css("--color-neutral-200") : css("--color-neutral-700"),
|
||||||
secondaryColor: css("--color-secondary-200"),
|
primaryColor: isDark ? css("--color-primary-700") : css("--color-primary-200"),
|
||||||
tertiaryColor: css("--color-neutral-100"),
|
secondaryColor: isDark ? css("--color-secondary-700") : css("--color-secondary-200"),
|
||||||
primaryBorderColor: css("--color-primary-400"),
|
tertiaryColor: isDark ? css("--color-neutral-700") : css("--color-neutral-100"),
|
||||||
|
primaryBorderColor: isDark ? css("--color-primary-500") : css("--color-primary-400"),
|
||||||
secondaryBorderColor: css("--color-secondary-400"),
|
secondaryBorderColor: css("--color-secondary-400"),
|
||||||
tertiaryBorderColor: css("--color-neutral-400"),
|
tertiaryBorderColor: isDark ? css("--color-neutral-300") : css("--color-neutral-400"),
|
||||||
lineColor: css("--color-neutral-600"),
|
lineColor: isDark ? css("--color-neutral-300") : css("--color-neutral-600"),
|
||||||
fontFamily:
|
fontFamily:
|
||||||
"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif",
|
"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif",
|
||||||
fontSize: "16px",
|
fontSize: "16px",
|
||||||
|
pieTitleTextSize: "19px",
|
||||||
|
pieSectionTextSize: "16px",
|
||||||
|
pieLegendTextSize: "16px",
|
||||||
|
pieStrokeWidth: "1px",
|
||||||
|
pieOuterStrokeWidth: "0.5px",
|
||||||
|
pieStrokeColor: isDark ? css("--color-neutral-300") : css("--color-neutral-400"),
|
||||||
|
pieOpacity: "1",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,6 +12,7 @@ autoSwitchAppearance = true
|
||||||
enableSearch = false
|
enableSearch = false
|
||||||
enableCodeCopy = false
|
enableCodeCopy = false
|
||||||
enableImageLazyLoading = true
|
enableImageLazyLoading = true
|
||||||
|
enableImageWebp = true
|
||||||
|
|
||||||
# robots = ""
|
# robots = ""
|
||||||
fingerprintAlgorithm = "sha256"
|
fingerprintAlgorithm = "sha256"
|
||||||
|
|
|
@ -12,6 +12,7 @@ autoSwitchAppearance = true
|
||||||
enableSearch = true
|
enableSearch = true
|
||||||
enableCodeCopy = true
|
enableCodeCopy = true
|
||||||
enableImageLazyLoading = true
|
enableImageLazyLoading = true
|
||||||
|
enableImageWebp = true
|
||||||
|
|
||||||
# robots = ""
|
# robots = ""
|
||||||
fingerprintAlgorithm = "sha256"
|
fingerprintAlgorithm = "sha256"
|
||||||
|
|
|
@ -1,64 +1,28 @@
|
||||||
{{ $url := urls.Parse .Destination }}
|
{{ $url := urls.Parse .Destination }}
|
||||||
{{ $altText := .Text }}
|
{{ $altText := .Text }}
|
||||||
{{ $caption := .Title }}
|
{{ $caption := .Title }}
|
||||||
{{ $lazyLoad := $.Page.Site.Params.enableImageLazyLoading | default true }}
|
{{ $class := "mx-auto my-0 rounded-md" }}
|
||||||
{{ if findRE "^https?" $url.Scheme }}
|
|
||||||
<figure>
|
{{ $file := $url.Path }}
|
||||||
<img
|
{{ $img := .Page.Resources.GetMatch $file }}
|
||||||
class="mx-auto my-0 rounded-md"
|
{{- if and (not $img) .Page.File }}
|
||||||
src="{{ $url.String }}"
|
{{ $path := path.Join .Page.File.Dir $file }}
|
||||||
alt="{{ $altText }}"
|
{{ $img = resources.Get $path }}
|
||||||
{{ if $lazyLoad }}
|
{{ end -}}
|
||||||
loading="lazy"
|
|
||||||
{{ end }}
|
{{/* https://github.com/gohugoio/hugo/pull/10666/files */}}
|
||||||
/>
|
{{- $params := $url.Query -}}
|
||||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
{{- $x2Param := $params.Get "x2" -}}
|
||||||
</figure>
|
{{- $x2 := false -}}
|
||||||
{{ else }}
|
{{- if eq $x2Param "true" -}}
|
||||||
{{ $resource := "" }}
|
{{- $x2 = true -}}
|
||||||
{{ if $.Page.Resources.GetMatch ($url.String) }}
|
{{- end -}}
|
||||||
{{ $resource = $.Page.Resources.GetMatch ($url.String) }}
|
|
||||||
{{ else if resources.GetMatch ($url.String) }}
|
<figure>
|
||||||
{{ $resource = resources.Get ($url.String) }}
|
{{- with $img -}}
|
||||||
{{ end }}
|
{{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class "x2" $x2) }}
|
||||||
{{ with $resource }}
|
{{- else -}}
|
||||||
<figure>
|
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
||||||
<img
|
{{- end -}}
|
||||||
class="mx-auto my-0 rounded-md"
|
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
||||||
{{ if eq .MediaType.SubType "svg" }}
|
</figure>
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
{{ if lt .Width 660 }}
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
srcset="
|
|
||||||
{{- (.Resize "330x").RelPermalink }} 330w,
|
|
||||||
{{- (.Resize "660x").RelPermalink }} 660w,
|
|
||||||
{{- (.Resize "1024x").RelPermalink }} 1024w,
|
|
||||||
{{- (.Resize "1320x").RelPermalink }} 2x"
|
|
||||||
src="{{ (.Resize "660x").RelPermalink }}"
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
alt="{{ $altText }}"
|
|
||||||
{{ if $lazyLoad }}
|
|
||||||
loading="lazy"
|
|
||||||
{{ end }}
|
|
||||||
/>
|
|
||||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
|
||||||
</figure>
|
|
||||||
{{ else }}
|
|
||||||
<figure>
|
|
||||||
<img
|
|
||||||
class="mx-auto my-0 rounded-md"
|
|
||||||
src="{{ $url.String }}"
|
|
||||||
alt="{{ $altText }}"
|
|
||||||
{{ if $lazyLoad }}
|
|
||||||
loading="lazy"
|
|
||||||
{{ end }}
|
|
||||||
/>
|
|
||||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
|
||||||
</figure>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
|
@ -15,25 +15,9 @@
|
||||||
</div>
|
</div>
|
||||||
{{ with $feature }}
|
{{ with $feature }}
|
||||||
<div class="prose">
|
<div class="prose">
|
||||||
<img
|
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
|
||||||
class="mb-6 -mt-4 rounded-md"
|
{{ $class := "mb-6 -mt-4 rounded-md" }}
|
||||||
{{ if eq .MediaType.SubType "svg" }}
|
{{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
{{ if lt .Width 660 }}
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
srcset="
|
|
||||||
{{- (.Resize "330x").RelPermalink }} 330w,
|
|
||||||
{{- (.Resize "660x").RelPermalink }} 660w,
|
|
||||||
{{- (.Resize "1024x").RelPermalink }} 1024w,
|
|
||||||
{{- (.Resize "1320x").RelPermalink }} 2x"
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}"
|
|
||||||
/>
|
|
||||||
{{ with $.Params.coverCaption }}
|
{{ with $.Params.coverCaption }}
|
||||||
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
|
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
{{ $img := .img }}
|
||||||
|
{{ $alt := .alt }}
|
||||||
|
{{ $class := .class }}
|
||||||
|
{{ $lazy := .lazy }}
|
||||||
|
{{ $webp := .webp }}
|
||||||
|
{{ $lqip := .lqip }}
|
||||||
|
{{ $x2 := .x2 | default false }}
|
||||||
|
|
||||||
|
{{ with $img }}
|
||||||
|
{{ if (eq .MediaType.SubType "svg") }}
|
||||||
|
{{ $width := ""}}
|
||||||
|
{{ $height := ""}}
|
||||||
|
{{ $svgContent := .Content }}
|
||||||
|
{{ range (findRESubmatch `<svg[^>]*width=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
|
||||||
|
{{ $width = index . 1 }}
|
||||||
|
{{ end }}
|
||||||
|
{{ range (findRESubmatch `<svg[^>]*height=["']([.0-9]*)["'a-zA-Z]` $svgContent 1) }}
|
||||||
|
{{ $height = index . 1 }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if (eq "" $width $height) }}
|
||||||
|
{{ range (findRESubmatch `<svg[^>]*viewBox=["']?([.0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*)` $svgContent 1) }}
|
||||||
|
{{ $width = index . 3 }}
|
||||||
|
{{ $height = index . 4 }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if (eq "" $width $height) }}
|
||||||
|
{{ warnf "Can't detect width and height for SVG %s" .RelPermalink }}
|
||||||
|
{{/* do not use lazy without dimensions */}}
|
||||||
|
{{ $lazy = false }}
|
||||||
|
{{ end }}
|
||||||
|
<picture {{ with $class }} class="{{ . }}" {{ end }}>
|
||||||
|
<img
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
{{ with $width }} width="{{ . }}" {{ end }}
|
||||||
|
{{ with $height }} height="{{ . }}" {{ end }}
|
||||||
|
{{ with $class }} class="{{ . }}" {{ end }}
|
||||||
|
{{ with $alt }} alt="{{ . }}" {{ end }}
|
||||||
|
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
|
||||||
|
>
|
||||||
|
</picture>
|
||||||
|
{{ else }}
|
||||||
|
<picture
|
||||||
|
{{ with $class }} class="{{ . }}" {{ end }}
|
||||||
|
{{ if $lqip }}
|
||||||
|
{{ $bg := (.Resize "20x webp q20").Content | base64Encode }}
|
||||||
|
style="background-image:url(data:image/webp;base64,{{ $bg }});background-size:cover"
|
||||||
|
{{ end }}
|
||||||
|
>
|
||||||
|
{{ $width := .Width }}
|
||||||
|
{{ $height := .Height }}
|
||||||
|
{{ if $x2 }}
|
||||||
|
{{ $width = div .Width 2 }}
|
||||||
|
{{ $height = div .Height 2 }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if $webp }}
|
||||||
|
<source
|
||||||
|
{{ if lt .Width 660 }}
|
||||||
|
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
srcset="
|
||||||
|
{{- (.Resize "330x webp").RelPermalink }} 330w,
|
||||||
|
{{- (.Resize "660x webp").RelPermalink }} 660w
|
||||||
|
{{ if gt .Width 1024 }}
|
||||||
|
,{{ (.Resize "1024x webp").RelPermalink }} 1024w
|
||||||
|
{{ else }}
|
||||||
|
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||||
|
,{{ .RelPermalink }} {{ .Width }}w
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if gt .Width 1320 }}
|
||||||
|
,{{ (.Resize "1320x webp").RelPermalink }} 2x
|
||||||
|
{{ else }}
|
||||||
|
{{ with .Resize (printf "%dx%d webp" .Width .Height) }}
|
||||||
|
,{{ .RelPermalink }} {{ .Width }}w
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}"
|
||||||
|
src="{{ (.Resize "660x webp").RelPermalink }}"
|
||||||
|
{{ end }}
|
||||||
|
type="image/webp"
|
||||||
|
/>
|
||||||
|
{{ end }}
|
||||||
|
<img
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
width="{{ $width }}"
|
||||||
|
height="{{ $height }}"
|
||||||
|
{{ with $class }} class="{{ . }}" {{ end }}
|
||||||
|
{{ with $alt }} alt="{{ . }}" {{ end }}
|
||||||
|
{{ with $lazy }} loading="lazy" decoding="async" {{ end }}
|
||||||
|
{{ if lt .Width 660 }}
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
{{ else }}
|
||||||
|
srcset="
|
||||||
|
{{- (.Resize "330x").RelPermalink }} 330w,
|
||||||
|
{{- (.Resize "660x").RelPermalink }} 660w
|
||||||
|
{{ if gt .Width 1024 }}
|
||||||
|
,{{ (.Resize "1024x").RelPermalink }} 1024w
|
||||||
|
{{ else }}
|
||||||
|
,{{ .RelPermalink }} {{ .Width }}w
|
||||||
|
{{ end }}
|
||||||
|
{{ if gt .Width 1320 }}
|
||||||
|
,{{ (.Resize "1320x").RelPermalink }} 2x
|
||||||
|
{{ else }}
|
||||||
|
,{{ .RelPermalink }} {{ .Width }}w
|
||||||
|
{{ end }}"
|
||||||
|
src="{{ (.Resize "660x").RelPermalink }}"
|
||||||
|
{{ end }}
|
||||||
|
>
|
||||||
|
</picture>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{{ $img := .img }}
|
||||||
|
{{ $alt := .alt }}
|
||||||
|
{{ $class := .class }}
|
||||||
|
{{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }}
|
||||||
|
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
|
||||||
|
{{ $lqip := false }}
|
||||||
|
{{ $x2 := .x2 }}
|
||||||
|
{{ partial "picture.html" (dict "img" $img "alt" $alt "class" $class "lazy" $lazy "webp" $webp "lqip" $lqip "x2" $x2) }}
|
|
@ -6,45 +6,23 @@
|
||||||
{{ $caption := .Get "caption" }}
|
{{ $caption := .Get "caption" }}
|
||||||
{{ $href := .Get "href" }}
|
{{ $href := .Get "href" }}
|
||||||
{{ $class := .Get "class" }}
|
{{ $class := .Get "class" }}
|
||||||
|
|
||||||
|
{{ $file := $url.Path }}
|
||||||
|
{{ $img := .Page.Resources.GetMatch $file }}
|
||||||
|
{{- if and (not $img) .Page.File }}
|
||||||
|
{{ $path := path.Join .Page.File.Dir $file }}
|
||||||
|
{{ $img = resources.Get $path }}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
<figure{{ with $class }} class="{{ . }}"{{ end }}>
|
<figure{{ with $class }} class="{{ . }}"{{ end }}>
|
||||||
{{ with $href }}<a href="{{ . }}">{{ end }}
|
{{ with $href }}<a href="{{ . }}">{{ end }}
|
||||||
<img
|
|
||||||
class="mx-auto my-0 rounded-md"
|
{{- with $img -}}
|
||||||
alt="{{ $altText }}"
|
{{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
|
||||||
{{ if .Site.Params.enableImageLazyLoading | default true }}
|
{{- else -}}
|
||||||
loading="lazy"
|
<img src="{{ $url.String }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
{{ if findRE "^https?" $url.Scheme }}
|
|
||||||
src="{{ $url.String }}"
|
|
||||||
{{ else }}
|
|
||||||
{{ $resource := "" }}
|
|
||||||
{{ if $.Page.Resources.GetMatch ($url.String) }}
|
|
||||||
{{ $resource = $.Page.Resources.GetMatch ($url.String) }}
|
|
||||||
{{ else if resources.GetMatch ($url.String) }}
|
|
||||||
{{ $resource = resources.Get ($url.String) }}
|
|
||||||
{{ end }}
|
|
||||||
{{ with $resource }}
|
|
||||||
{{ if eq .MediaType.SubType "svg" }}
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
{{ if lt .Width 660 }}
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
{{ else }}
|
|
||||||
srcset="
|
|
||||||
{{- (.Resize "330x").RelPermalink }} 330w,
|
|
||||||
{{- (.Resize "660x").RelPermalink }} 660w,
|
|
||||||
{{- (.Resize "1024x").RelPermalink }} 1024w,
|
|
||||||
{{- (.Resize "1320x").RelPermalink }} 2x"
|
|
||||||
src="{{ (.Resize "660x").RelPermalink }}"
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ else }}
|
|
||||||
src="{{ $url.String }}"
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
/>
|
|
||||||
{{ with $href }}</a>{{ end }}
|
{{ with $href }}</a>{{ end }}
|
||||||
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
{{ with $caption }}<figcaption class="text-center">{{ . | markdownify }}</figcaption>{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
|
|
|
@ -4,17 +4,16 @@
|
||||||
{{- if .Get "href" -}}
|
{{- if .Get "href" -}}
|
||||||
<a href="{{ .Get "href" }}">
|
<a href="{{ .Get "href" }}">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<img src="{{ $image.RelPermalink }}"
|
|
||||||
{{- if or (.Get "alt") (.Get "caption") }}
|
{{ $altText := "" }}
|
||||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
|
{{ with .Get "alt" }}
|
||||||
{{- end -}}
|
{{ $altText = . }}
|
||||||
{{ if .Site.Params.enableImageLazyLoading | default true }}
|
{{ else }}
|
||||||
loading="lazy"
|
{{ $altText = (.Get "caption") | markdownify | plainify }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
width="100%"
|
|
||||||
height="auto"
|
{{ partial "pictureDefaults.html" (dict "img" $image "alt" $altText "x2" true) }}
|
||||||
style="max-width:{{ div $image.Width 2 }}px; max-height:{{ div $image.Height 2 }}px;"
|
|
||||||
/>
|
|
||||||
{{- if .Get "href" }}</a>{{ end -}}
|
{{- if .Get "href" }}</a>{{ end -}}
|
||||||
{{- if .Get "caption" -}}
|
{{- if .Get "caption" -}}
|
||||||
<figcaption>
|
<figcaption>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hugo-congo-theme",
|
"name": "hugo-congo-theme",
|
||||||
"version": "2.7.5",
|
"version": "2.7.6",
|
||||||
"description": "Congo theme for Hugo",
|
"description": "Congo theme for Hugo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "rimraf assets/lib",
|
"preinstall": "rimraf assets/lib",
|
||||||
|
|
Loading…
Reference in New Issue