Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert a linebreak in hugo image tag title element?

I am using blogdown and kakawait/hugo-tranquilpeak-theme to write a plain markdown blog post. When I add images with the shortcode option tag such as

{{< image classes="fancybox right clear" src="image2.png"     
thumbnail="http://google.fr/images/image125.png" group="group:travel"   
thumbnail-width="150px" thumbnail-height="300px" title="A beautiful    
sunrise" >}}

I am unable to break the title of the image. Now I have

A beautiful image

But I would like

A beautiful 
image

BTW, these breaks:

\n
<br>
<br />

don't work for me. Any idea how to solve this?

like image 718
Philipp Gärtner Avatar asked Sep 29 '17 12:09

Philipp Gärtner


1 Answers

We can use Shortcodes to break lines.

Make line_break.html file inside layouts/shortcodes and add <br /> tag to it. So line_break.html file will look like this:

<br />

Now you can use this Shortcode to your markdown file by adding {{< line_break >}}. So in your case, it will look like this:

A beautiful
{{< line_break >}}
image
like image 156
Rajiv Singh Avatar answered Nov 14 '22 07:11

Rajiv Singh