mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
59 lines
1.9 KiB
Markdown
59 lines
1.9 KiB
Markdown
+++
|
|
title = "Image Effects"
|
|
weight = 5
|
|
+++
|
|
|
|
The theme supports non-standard [image effects](cont/markdown#image-effects).
|
|
|
|
As described, you can add this to the URL query parameter, but this may be cumbersome to do it consistently for the whole page.
|
|
|
|
Instead, you can configure the defaults in your `hugo.toml` aswell as overriding these default in the pages frontmatter.
|
|
|
|
Explicitly set URL query parameter will override the defaults in effect for a page.
|
|
|
|
Without any settings in your `hugo.toml` this defaults to
|
|
|
|
{{< multiconfig file=hugo >}}
|
|
[params]
|
|
[params.imageEffects]
|
|
border = false
|
|
lightbox = true
|
|
shadow = false
|
|
{{< /multiconfig >}}
|
|
|
|
This can be overridden in a pages frontmatter by eg.
|
|
|
|
{{< multiconfig fm=true >}}
|
|
[imageEffects]
|
|
border = true
|
|
{{< /multiconfig >}}
|
|
|
|
Or by explicitly override settings by URL query parameter
|
|
|
|
````md {title="URL"}
|
|
![Minion](https://octodex.github.com/images/minion.png?lightbox=false&bg-white=true)
|
|
````
|
|
|
|
The settings applied to the above image would be
|
|
|
|
{{< multiconfig >}}
|
|
border = true
|
|
lightbox = false
|
|
shadow = false
|
|
bg-white = true
|
|
{{< /multiconfig >}}
|
|
|
|
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
|
|
|
|
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.
|
|
|
|
{{% notice note %}}
|
|
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.
|
|
{{% /notice %}}
|