I’m working on a project right now that makes heavy use of code samples. What I’d like to be able to do is store those samples as strings (I have a complex generation script that makes those strings…long story) and have Hugo respect newlines in those strings. Here’s a very basic example:
What I’d like to be able to do is to make those strings respect the newline, like so:
Is there a Hugo function that does this? I’ve tried a bunch of them but none have worked thus far.
Okay, actually I mischaracterized the issue. The issue is that I need to generate strings with newlines and have Hugo respect those newlines. I was confusing two things I was working on, derp. Something like this:
@zwbetz Unfortunately Hugo just gives the raw string inside of <code>. I’m not sure there’s a great way directly around this. I’ve come up with a workaround that involves avoiding string interpolation entirely and I’m satisfied with it Thanks for having a look!