Closed norayr closed 6 years ago
hugo
look like when these flags are added --verbose --debug
? (You can also add --renderToMemory
if you don't want to overwrite past renders.)thank you.
does this pour some light on what is happening with tags and categories?
i have just tried latin tags and categories - the pages anyway are empty.
apparently, the file public/categories/պատմութիւններ/index.xml does contain links to the posts tagged with this category. but the live web page does not show that content.
I think I found the problem. Hugo uses the names of directories under content/
to determine a file's section. So the "section" of content/post/first.md
is "post", but the "section" of content/posts/first.md
is "posts".
When you click on a category link, the theme is currently designed to only list content where the "section" is exactly "post", not "posts".
The issue should be fixed quickly if you just rename your directory to "posts" and update old links like these.
I can't recreate your issue. I have tried everything and both categories and tags work. I am using Hugo Static Site Generator v0.41 linux/amd64 BuildDate: 2018-05-25T20:22:33Z I tried wit this, which I added to the exampleSite /content/post/work1.md:
categories = [ "design", "պատմութիւններ"]
tags = ["one","two"]
The only problem I have noticed is that categories are case sensitive and neeed to be in lower case.
mine too is fresh
$ hugo version
Hugo Static Site Generator v0.41-B5B36E32 linux/amd64 BuildDate: 2018-05-27T05:33:44+0400
can you try to download https://github.com/norayr/film-magazine and run hugo server -D and connect to web server in order to see what is happening? Also see which files are generated. I have added nederburg theme as a submodule, as recommended, so you alse will need to pull the submodule. probably you know it all better than me.
when you'll reproduce it, you can also try the theme 'minimo', under that both tags and categories work.
i am also thinking that probably i have something in the content which is extra, or which make the theme to not fully work.
I fixed the problem! I used the "posts" directory for posts, that's why it did not work. Then renamed to հոսք. Now tried to rename it as "post", and now it works.
So should it be "post"? Is it hardcoded? Do you like the idea to change this behaviour?
Hi, good that it works! The correct name is post. I don't think it's hard coded. I don't know what you mean by changing this behaviour. But don't change it if it works.
thanks, @codeactual for pointing this.
ok I see, that tags work only for one directory, mentioned in layout/partials/tag.html on line 7, and categories only work for one directory, mentioned in layout/partials/category.html on line 7.
okay, let's say it has to be directory named "post" and we put posts there.
I also have a directory "authors" where I put author pages. This means tags and categories don't work for them.
Can you suggest how to change the line
{{ range $index, $element := (where .Data.Pages "Section" "post") }}
so that tags would work for more than one directory, for files in "post" and in lets say "authors" as well.
thank you.
This could be a possible solution with a IN operator in the range statement
{{{ range where .Paginator.Pages "Section" "in" (slice "aaa" "bbb") }}
https://discourse.gohugo.io/t/range-statement-where-clause-with-or-logic-operator/1385/4
hello,
clicks on tag or category links bring empty pages. when I change the theme, the issue disappears. i guess, may be this is connected to unicode in the names of tags and categories?
reference issue #13 contains links to the github source and online web pages. reference commit #14 fixed part of the problems described in reference issue.
thank you!