diff --git a/config/_default/params.toml b/config/_default/params.toml index 6ff9d52a..bfb00e4c 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -15,7 +15,9 @@ enableCodeCopy = true # mainSections = ["section1", "section2"] # robots = "" -#defaultBackgroundImage = "IMAGE.jpg" # used as default for background images +# disableImageOptimization = false + +# defaultBackgroundImage = "IMAGE.jpg" # used as default for background images [header] layout = "basic" # valid options: basic, fixed diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 3943b16e..7645f475 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -15,6 +15,8 @@ enableCodeCopy = true mainSections = ["docs"] # robots = "" +disableImageOptimization = false + defaultBackgroundImage = "/img/iceland.jpg" [header] diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index a66ee656..cd866d7a 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -137,6 +137,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `showLikes` | _Not set_ | Whether or not articles and list likes are displayed. This requires firebase integrations to be enabled, look below. | | `robots` | _Not set_ | String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values. | | `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. | +| `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. | | `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style | | `header.layout` | `"basic"` | Defines the header for the entire site, supported values are `basic` and `fixed`. | | `footer.showMenu` | `true` | Show/hide the footer menu, which can be configured in the `[[footer]]` section of the `config/_default/menus.en.toml` file. | diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index e8220ca6..a9a4a15b 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -1,3 +1,4 @@ +{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} {{ if .Get "default" }} {{ template "_internal/shortcodes/figure.html" . }} {{ else }} @@ -21,6 +22,13 @@ {{ with $resource }}
{{ with $href }}{{ end }} + {{ if $disableImageOptimization }} + {{ $altText }} + {{ else }} {{ $altText }} + {{ end }} {{ if $href }}{{ end }} {{ with $caption }}
{{ . | markdownify }}
{{ end }}