2023-08-25 17:09:50 +00:00
+++
title = "Image Effects"
2023-11-28 22:52:24 +00:00
weight = 5
2023-08-25 17:09:50 +00:00
+++
2023-10-24 20:49:34 +00:00
The theme supports non-standard [image effects ](cont/markdown#image-effects ).
2023-08-25 17:09:50 +00:00
As described, you can add this to the URL query parameter, but this may be cumbersome to do it consistently for the whole page.
2023-11-29 23:14:22 +00:00
Instead, you can configure the defaults in your `hugo.toml` aswell as overriding these default in the pages frontmatter.
2023-08-25 17:09:50 +00:00
Explicitly set URL query parameter will override the defaults in effect for a page.
2023-11-29 23:14:22 +00:00
Without any settings in your `hugo.toml` this defaults to
2023-08-25 17:09:50 +00:00
2024-03-02 10:04:52 +00:00
{{< multiconfig file = hugo > }}
2023-08-25 17:09:50 +00:00
[params]
[params.imageEffects]
border = false
lightbox = true
shadow = false
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2023-08-25 17:09:50 +00:00
This can be overridden in a pages frontmatter by eg.
2024-03-02 10:04:52 +00:00
{{< multiconfig fm = true > }}
2023-08-25 17:09:50 +00:00
[imageEffects]
border = true
2024-03-02 10:04:52 +00:00
{{< / multiconfig > }}
2023-08-25 17:09:50 +00:00
Or by explicitly override settings by URL query parameter
2024-03-02 10:04:52 +00:00
````md {title="URL"}
2023-08-25 17:09:50 +00:00
![Minion ](https://octodex.github.com/images/minion.png?lightbox=false&bg-white=true )
````
The settings applied to the above image would be
2024-03-02 10:04:52 +00:00
{{< multiconfig > }}
border = true
lightbox = false
shadow = false
bg-white = true
{{< / multiconfig > }}
2023-08-25 17:09:50 +00:00
This ends up in the following HTML where the parameter are converted to CSS classes.
````html {title="HTML"}
< img src = "https://octodex.github.com/images/minion.png?lightbox=false&bg-white=true" alt = "Minion" class = "bg-white border nolightbox noshadow" >
````
## Extending
2023-11-29 23:14:22 +00:00
As you can see in the above example, the `bg-white` parameter is not initially supported in the themes default settings. Nevertheless you are free to define arbitrary parameter by just adding them to the URL query parameter or set them in your `hugo.toml` or pages frontmatter.
2023-08-25 17:09:50 +00:00
{{% notice note %}}
2023-11-29 23:14:22 +00:00
If no extended parameter like `bg-white` in the example is set on the URL, a `class="nobg-white"` in the HTML will only be generated if a default value was set in the `hugo.toml` or pages frontmatter.
2023-08-25 17:09:50 +00:00
{{% /notice %}}