Skip to content
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

empty page when clicking on category or tag links #16

Closed
norayr opened this issue May 31, 2018 · 11 comments
Closed

empty page when clicking on category or tag links #16

norayr opened this issue May 31, 2018 · 11 comments

Comments

@norayr
Copy link

norayr commented May 31, 2018

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!

@codeactual
Copy link
Contributor

  1. We can maybe test if it's connected to unicode by changing the post in tags and categories don't work for me #13 to have a non-unicode category and seeing of the link works.
  2. What does the output from hugo look like when these flags are added --verbose --debug? (You can also add --renderToMemory if you don't want to overwrite past renders.)

@norayr
Copy link
Author

norayr commented Jun 2, 2018

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.

@norayr
Copy link
Author

norayr commented Jun 2, 2018

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.

@codeactual
Copy link
Contributor

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.

@appernetic
Copy link
Collaborator

appernetic commented Jun 3, 2018

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.
screenshot-2018-6-3

@norayr
Copy link
Author

norayr commented Jun 6, 2018

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.

@norayr
Copy link
Author

norayr commented Jun 7, 2018

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?

@brorio
Copy link

brorio commented Jun 7, 2018

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.

@norayr
Copy link
Author

norayr commented Jun 7, 2018

thanks, @codeactual for pointing this.

@norayr
Copy link
Author

norayr commented Jun 7, 2018

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.

@appernetic
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants