Sort a post's categories/tags alphabetically? (micro.blog)
@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...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@maiki wrote: bix: So, how do I do it? Can I? gohugo.io – 1 Feb 17 sort Sorts maps, arrays, and slices and returns a sorted slice. Give the sort an argument, should work. Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: I’ve tried that, with whatever kinds of arguments I’ve found so far in other discussions of sort. They all cough up errors. Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: Anyone know if there’s a way to pull a post’s tags into a separate list or array or whatever and then sort that alphabetically? Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@zwbetz wrote: Yep. Give this a try {{ $tags := .Params.tags }} {{ sort $tags }} Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: Which does output [Architecture Design Technology] but how do I incorporate this idea into the original {{ range .Params.categories }}<a href="{{ "/categories/" }}{{ . | urlize...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@zwbetz wrote: Have you tried? {{ range (sort .Params.categories) }} Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: See the original post. (tl;dr: range sort technically works, but causes page render/site build error messages anyway.) Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@zwbetz wrote: bix: Weirdly, if I just add sort after range is does work but it also throws up template errors in my micro.blog account. You need to explain more about this. Also, what hugo version...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: I’m not sure what else to explain. Existing code lists the categories the blog post is in, but I can’t seem to find any method, or anyone else who has found any method, for having them...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@zwbetz wrote: I’m not familiar with micro blog, or how you’ve integrated it with hugo. Maybe someone else can help you there. Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@maiki wrote: bix: I have no idea what Hugo version; as noted, this is on a Micro.blog blog; I don’t have access to that info. (I’m having similar discussions in the Micro.blog Slack, also to no...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: It’s literally this theme with the above {{ range .Params.categories }}<a href="{{ "/categories/" }}{{ . | urlize }}">{{ . }}</a> {{ end }} code added to the ‘single.html’...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@ju52 wrote: I have this in the head of my single.html {{ if isset .Params "categories" -}} {{ range $index, $name := sort .Params.categories -}} {{ with site.GetPage (printf "/%s" ($name | urlize ))...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: Oh. Hey. Hang on. That range $index, $name := sort .Params.categories bit might have just worked without any errors. Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@bix wrote: Okay, well, it worked in one Marfa edit and not another Marfa edit, but that fact and @ju52’s post led me to the why: if I in fact use even just my original code, but wrap it in an {{ if...
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@ju52 wrote: {{ if isset .Params “categories” }} gohugo.io – 1 Feb 17 isset Returns true if the parameter is set. Cab be, you have pages without categories??? Read full topic
View ArticleSort a post's categories/tags alphabetically? (micro.blog)
@zwbetz wrote: bix: if I in fact use even just my original code, but wrap it in an {{ if .Params.categories }} {{ end }} it all works, with no error messages about template builds. I don’t understand...
View Article