You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\o Hello! I've been working on Platen, a an open source toolkit for helping indie game writers and publishers put together digital editions of their games which are accessible, interactive, and multi-device friendly via hugo. I've based it on top of hugo-book because this theme/module is incredible and I believe in re-using excellent tools wherever possible.
One of my contributors, @binarystargames, recently submitted a Pull Request to Platen which extends the functionality of the columns shortcode to include variable column ratios if specified (default is current behavior, even columns). Rather than patch/maintain a fork of this shortcode in Platen, I think this would be a useful feature for general users of hugo-book.
The updated implementation:
<divclass="book-columns flex flex-wrap">
{{ if .Get "ratio" }}
{{ $ratioSplit := split (.Get "ratio") ":"}}
{{ range $i, $val := split .Inner "<--->" }}
{{ if gt (len $ratioSplit) $i}}
<divstyle="flex-grow:{{ index $ratioSplit $i }};" class="flex-even markdown-inner">
{{ $val | $.Page.RenderString }}
</div>
{{ end }}
{{ end }}
{{ else }}
{{ range split .Inner "<--->" }}
<divclass="flex-even markdown-inner">
{{ . | $.Page.RenderString }}
</div>
{{ end }}
{{ end }}
</div>
If this feature request is out of scope for hugo-book, that's okay! I just wanted to make sure we're good community members and contributing potentially useful stuff back upstream wherever possible and I'd be happy to put up a PR for this if the feature is accepted (and @binarystargames prefers I put it up).
The text was updated successfully, but these errors were encountered:
Hi!
Thanks for detailed issue! also nice to see that theme is used :)
It looks alright, I have a bit of mixed feeling on how obvious it is to configure. I like to keep configuration simple, so that is no need to consult docs or source code,
I will sit on this idea for some time and will come back to you.
Open to implementation update ideas too of course! switching to either positional or flexible parameter declarations wouldn't be a problem. Would writing up a draft PR with the docs included (to mirror extant docs) be useful?
Happy to address any specific usage concerns you might have as well! I tried to make it resilient to things like implemented column/ratio mismatch, putting non-numeric characters in, etc - barring egregious cases it should generally do something that makes sense.
\o Hello! I've been working on Platen, a an open source toolkit for helping indie game writers and publishers put together digital editions of their games which are accessible, interactive, and multi-device friendly via hugo. I've based it on top of
hugo-book
because this theme/module is incredible and I believe in re-using excellent tools wherever possible.One of my contributors, @binarystargames, recently submitted a Pull Request to Platen which extends the functionality of the columns shortcode to include variable column ratios if specified (default is current behavior, even columns). Rather than patch/maintain a fork of this shortcode in Platen, I think this would be a useful feature for general users of
hugo-book
.The updated implementation:
If this feature request is out of scope for
hugo-book
, that's okay! I just wanted to make sure we're good community members and contributing potentially useful stuff back upstream wherever possible and I'd be happy to put up a PR for this if the feature is accepted (and @binarystargames prefers I put it up).The text was updated successfully, but these errors were encountered: