Quantcast
Channel: Sort a post's categories/tags alphabetically? (micro.blog)
Viewing all articles
Browse latest Browse all 18

Sort a post's categories/tags alphabetically? (micro.blog)

$
0
0

@bix wrote:

As near as I’ve been able to tell through countless google searches, this doesn’t seem to be possible, but in the event my google-fu is just bad, I’ll directly ask here.

(Disclaimer: I am not Hugo proficient, per se, but once upon a time I did a lot of self-hosted Moveable Type and WordPress blogging so I have enough general templating/theming experience to probably be able to follow along here.)

Currently over on micro.blog each of my blog posts displays the categories I’ve filed it in, using this code (which I don’t even remember where I found).

{{ range .Params.categories }}<a href="{{ "/categories/" }}{{ . | urlize }}">{{ . }}</a> {{ end }}

Is there no way, via sort or otherwise, to get these to display alphabetically? Weirdly, if I just add sort after range is does work but it also throws up template errors in my micro.blog account.

Theme error: Error building site: failed to render pages: render of "page" failed: "/bix_504e91/layouts/post/single.html:17:12": execute of template failed: template: post/single.html:17:12: executing "main" at : error calling sort: sequence must be provided

While this error doesn’t, for some reason, actually seem to stop the page in question from rendering do seem to cause trouble elsewhere, but mostly I just assume that if it’s barfing up an error at all, despite working, I shouldn’t do it.

So, how do I do it? Can I?

Thanks.

Read full topic


Viewing all articles
Browse latest Browse all 18

Trending Articles