-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct taxonomy declaration in category #20
Conversation
I can confirm that this patch brings us closer to a correct rendering. I also needed to add:
to ensure that taxo_list was, in fact, a list. Sometimes (for categories), it comes in as a string. |
Here's the full patch I had to apply: diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml
index 69e361e..6bf08ae 100644
--- a/layouts/_default/list.atom.xml
+++ b/layouts/_default/list.atom.xml
@@ -104,12 +104,15 @@
{{ printf `<content type="html"><![CDATA[%s%s]]></content>` $description .Content | safeHTML }}
{{ with site.Taxonomies }}
{{ range $taxo,$_ := . }} <!-- Defaults taxos: "tags", "categories" -->
- {{ with $page.Param $taxo }}
+ {{ with $page.Param $taxo }}
{{ $taxo_list := . }} <!-- $taxo_list will be the tags/categories list -->
+ {{ if not (reflect.IsSlice $taxo_list) }}
+ {{ $taxo_list = slice $taxo_list }}
+ {{ end }}
{{ with site.GetPage (printf "/%s" $taxo) }}
{{ $taxonomy_page := . }}
{{ range $taxo_list }} <!-- Below, assuming pretty URLs -->
- <category scheme="{{ printf "%s%s" $taxonomy_page.Permalink (. | urlize) }}" term="{{ (. | urlize) }}" label="{{ . }}" />
+ <category scheme="taxonomy:{{ printf "%s" $taxo | humanize }}" term="{{ (. | urlize) }}" label="{{ . }}" />
{{ end }}
{{ end }}
{{ end }} It would be great not to have to maintain a fork of this theme; @kaushalmodi any chance you'd be willing to look at the PR? |
@stefanv I am not active in Hugo development lately, but to your comment
That looks strange. I have never seen that happen. Should that be an issue on Hugo? |
Happens if you set |
Thanks @kaushalmodi! |
This is part of a larger move to integrate all blog functionality into the theme, instead of into blog.scientific-python.org. Before, we used to use a custom fork of kaushalmodi's theme. However, with kaushalmodi/hugo-atom-feed#20 merged, we can make use of the original.
This is part of a larger move to integrate all blog functionality into the theme, instead of into blog.scientific-python.org. Before, we used to use a custom fork of kaushalmodi's theme. However, with kaushalmodi/hugo-atom-feed#20 merged, we can make use of the original.
Based on this, this and my RSS derivate of this feed template, I believe that the category should reflect the taxonomy type in a different scheme.
A URI does not necessarily mean that it is a real URL / internet address (URI != URL, but URL = URI :-)).