Dashes between the words of the title

Hello together,
I am quite new with hugo but its going well. However now I have a question regarding dashes between the words of the title.

This is a part of my hugo code in the single.html:

<source type='image/svg+xml' srcset='{{ .Site.BaseURL }}images{{ .RelPermalink }}hero/1200XL/2232-hero-{{lower .LinkTitle }}-firmenname-001.webp' media='(min-width: 1200px) and (-webkit-min-device-pixel-ratio: 2), (min-width: 1200px) and (min-resolution: 192dpi)'>

It will rendered into this:

<source type='image/svg+xml' srcset='http://localhost:1313/images/referenz/bildung/schule-am-weingut/hero/1200XL/2232-hero-schule am weingut-firmenname-001.webp' media='(min-width: 1200px) and (-webkit-min-device-pixel-ratio: 2), (min-width: 1200px) and (min-resolution: 192dpi)'>

The problem is, that I need dashes in the link:

schule am weingut

Do you have an idea?

Simply use:
{{ .LinkTitle | urlize }}

Also see:

1 Like

Oh great! Very easy! Thank you, it works!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.