Hugo Shortcodes
GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Highlight

How to use

# file.md
{{< highlight text="text to highlight" >}}

{{< highlight text="text to highlight" color="#000" >}}

Shortcode


{{ $color := "#FFFF00" }}
{{ with .Get "color" }}
    {{ $color = . }}    
{{ end }}
<mark style="background-color: {{ $color }}">{{ with .Get "text" }}{{.}}{{end}}</mark>

Sample

text to highlight

text to highlight

Base Source