hugo-theme-relearn/exampleSite/content/authoring/imageeffects.en.md

59 lines
2.1 KiB
Markdown
Raw Normal View History

2024-10-07 13:30:53 +00:00
+++
2024-10-12 17:28:28 +00:00
categories = ["explanation"]
2024-10-11 14:27:13 +00:00
description = "How to apply graphical effects to your images"
2024-10-07 13:30:53 +00:00
frontmatter = ["imageEffects"]
2024-10-11 14:27:13 +00:00
title = "Image Effects"
weight = 5
2024-10-07 13:30:53 +00:00
+++
The theme offers [graphical effects](authoring/markdown#image-effects) for your linked images.
2024-10-11 14:27:13 +00:00
You can [define additional custom image effects and set defaults](configuration/customization/imageeffects) in your configuration.
2024-10-11 14:27:13 +00:00
The default image effects shipped with the theme are
2024-10-07 13:30:53 +00:00
| Name | Description |
| -------- | ----------------------------------------------------------------- |
| border | Draws a light thin border around the image |
| lazy | Lets the image be lazy loaded |
| lightbox | The image will be clickable to show it enlarged |
| shadow | Draws a shadow around the image to make it appear hovered/glowing |
One way to use them is to add them as URL query parameter to each individually linked image.
2024-10-07 13:30:53 +00:00
This can become cumbersome to be done consistently for the whole site. Instead, you can [configure the defaults](configuration/customization/imageeffects) in your `hugo.toml` as well as overriding these defaults in a page's front matter.
2024-10-11 14:27:13 +00:00
Explicitly set URL query parameter will override the defaults set for a page or your site.
2024-10-07 13:30:53 +00:00
Without any settings in your `hugo.toml` `imageEffects` defaults to
2024-10-11 14:27:13 +00:00
{{< multiconfig >}}
[imageEffects]
border = false
lazy = true
lightbox = true
shadow = false
2024-10-07 13:30:53 +00:00
{{< /multiconfig >}}
2024-10-11 14:27:13 +00:00
{{% badge style="green" icon="fa-fw fab fa-markdown" title=" " %}}Front Matter{{% /badge %}} This can be overridden in a pages front matter for example by
2024-10-07 13:30:53 +00:00
{{< multiconfig fm=true >}}
[imageEffects]
2024-10-11 14:27:13 +00:00
lazy = false
2024-10-07 13:30:53 +00:00
{{< /multiconfig >}}
Or by explicitly override settings by URL query parameter
````md {title="URL"}
2024-10-11 14:27:13 +00:00
![Minion](https://octodex.github.com/images/minion.png?lazy=true&lightbox=false)
2024-10-07 13:30:53 +00:00
````
The settings applied to the above image would be
{{< multiconfig >}}
border = true
lazy = true
lightbox = false
shadow = false
{{< /multiconfig >}}