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:
# data/samples.yaml
samples:
- "foo/nbar"
What I’d like to be able to do is to make those strings respect the newline, like so:
foo
bar
Is there a Hugo function that does this? I’ve tried a bunch of them but none have worked thus far.