parsiya/Hugo-Shortcodes

replacing underscore with space

marczz opened this issue · 2 comments

I don't do a pull request for that, but you can use (with your Scratch use, that is no more necessary)

 {{ $.Scratch.Set "wp_title" (replace (.Get 0) "_" " ")  }}

Of course it is untested, but I have similar code in my shortcodes.

Thanks for letting me know and apologies for the delay. It's a been a very busy few months. Seems like I skipped the conversion from "_" to space based on my comments.

The function you're looking for is named humanize.

{{ $.Scratch.get "wp_title" | humanize }}