diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 16:29:00 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-28 16:29:00 +0200 |
| commit | fb5b8ef00b74af2f2df9fe77937165eb04d18118 (patch) | |
| tree | d9d5509cbabb3d96a9585b169c584ade48ce04d6 /layouts/shortcodes | |
| parent | 6b0be385ffa2f020b8dbeab13670194a1986a52b (diff) | |
| download | gohugo-theme-ed-fb5b8ef00b74af2f2df9fe77937165eb04d18118.tar.gz | |
Provide an ability to use hreflang attribute in raw links
Diffstat (limited to 'layouts/shortcodes')
| -rw-r--r-- | layouts/shortcodes/img.html | 6 | ||||
| -rw-r--r-- | layouts/shortcodes/link.html | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 3d2b03f..4978358 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1 +1,5 @@ -<img src="{{ .Get "src" }}" {{- with .Get "alt" }} alt="{{.}}"{{ end }} {{- with .Get "width" }} width="{{.}}"{{ end }} {{- with .Get "height" }} height="{{.}}"{{ end }} {{- with .Get "class" }} class="{{.}}"{{ end }}> +<img src="{{ .Get "src" }}" + {{- with .Get "alt" }} alt="{{ . }}"{{ end }} + {{- with .Get "width" }} width="{{ . }}"{{ end }} + {{- with .Get "height" }} height="{{ . }}"{{ end }} + {{- with .Get "class" }} class="{{ . }}"{{ end }}> diff --git a/layouts/shortcodes/link.html b/layouts/shortcodes/link.html index b6993ec..3778d83 100644 --- a/layouts/shortcodes/link.html +++ b/layouts/shortcodes/link.html @@ -1 +1,8 @@ -<a href="{{ .Get "src" | absURL }}" {{- with .Get "title" }} title="{{.}}"{{ end }} {{- with .Get "class" }} class="{{.}}"{{ end }} {{- with .Get "target" }} target="{{.}}"{{ end }} {{- with .Get "rel" }} rel="{{.}}"{{ end }}>{{ .Inner }}</a> +<a href="{{ .Get "src" | absURL }}" + {{- with .Get "hreflang" }} hreflang="{{ . }}"{{ end }} + {{- with .Get "title" }} title="{{ . }}"{{ end }} + {{- with .Get "class" }} class="{{ . }}"{{ end }} + {{- with .Get "target" }} target="{{ . }}"{{ end }} + {{- with .Get "rel" }} rel="{{ . }}"{{ end }}> + {{- .Inner -}} +</a> |
