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

home page at wrong URL, many sections missing #3

Closed
mfioretti opened this issue Nov 3, 2018 · 9 comments
Closed

home page at wrong URL, many sections missing #3

mfioretti opened this issue Nov 3, 2018 · 9 comments
Assignees

Comments

@mfioretti
Copy link

@mfioretti mfioretti commented Nov 3, 2018

Greetings,

I am trying this theme with hugo v0.50, because it looks great, but I am having major problems. My "content" folder has this structure:

about.md
bio.md
<other pages>
post/  <==== this is the folder where all the blog posts are (renaming it to archives, blog, or anything else does not change what reported below)

the problem is that, with this theme only_

  • the home page, listing of all posts from newest to oldest, is /post/index.html, instead of being /index.html . That page is blank (only site name, menu and footer).
  • categories and tags of a post are not listed below it
  • it is not clear where/how to insert and format a sidebar
  • no search bar appears

The relevant part of the config.toml file is below. Changing publishDir to any value (post, /, whatever) seems to make no difference). Thanks in advance for your help

theme = "mediumish-gohugo-theme"

summaryLength = 25
sidebar       =  "true"
search        = "true"
publishDir    = "/"
Paginate=10
paginate=10
[permalinks]
   archives = "/:year/:month/:title/"
   post = "/:year/:month/:title/"
   
[taxonomies]
    category = "category"
    tag = "tag"

[Indexes]
    tag      = "tag"
    category = "category"

@lgaida
Copy link
Owner

@lgaida lgaida commented Nov 4, 2018

Hi @mfioretti

  • The /index.html is blank because you did not configure your blog correctly. The /index.html, in this theme, is a welcome/about/bio-page, depending on what you configure it to show in your config. The blogposts should be placed in a subfolder of your contentfolder. And the URL will then be subfolder/index.html to list all the posts.
  • To achieve the same rendering for other "standalone"-pages (bio.md and about.md) place the corresponding files in a content-subfolder named "static".
  • As for taxonomies, only tags are supported at the moment. And you will have to assign your tags in the frontmatter of every of your posts
  • There is no "sidebar" or "searchbar" in this theme, hence your config-params "search" and "sidebar" do not affect anything.

I recommend reading the README again.

@lgaida lgaida closed this Nov 4, 2018
@lgaida lgaida self-assigned this Nov 4, 2018
@mfioretti
Copy link
Author

@mfioretti mfioretti commented Nov 4, 2018

Hi @mfioretti

The /index.html is blank because you did not configure your blog correctly. The /index.html, in this theme, is a welcome/about/bio-page, depending on what you configure it to show in your config.

Hello @lgaida

Indeed, now I see that I was wrong to assume that this theme has search and sidebar. No idea why I gave it for granted, sorry. No big deal however, these are not showstoppers. About the other issues:

  1. Does this mean that, in this theme, the content of index.html is ONLY what goes in the params.index section of config.toml? Please confirm, or explain if I misunderstood
  2. "blogposts should be placed in a subfolder of your contentfolder. And the URL will then be subfolder/index.html to list all the posts": is there no way to change this behaviour in the general configuration settings? If not then switching to this theme would break lots of internal and external links in and to my posts.

If the issues above are confirmed, then OK, this specific theme does not suit my specific needs. Too bad, because it really looks great.

Thanks

@lgaida
Copy link
Owner

@lgaida lgaida commented Nov 7, 2018

Hello @mfioretti

No problem :)
Quickly answering your questions:

  1. Exactly that
  2. You will have to use the subfolders in this theme. However, you might be able to trick around it.

What you can try to hack around it:

  • copy this themes list.html (see layouts/_default/list.html) to the layouts folder in your projects root
  • rename this copied list.html to index.html

Hugo uses a specific template lookup order for rendering your project. So hugo should use your projects layouts/index.html instead of the theme one. If so, then you can also try to use the contentfolder directly instead of the subfolders.

Greetings 👍

@lgaida
Copy link
Owner

@lgaida lgaida commented Nov 20, 2018

I just tested the proposed work-around and can confirm that it works.
Referencing #4 due to a similar question.

@mfioretti
Copy link
Author

@mfioretti mfioretti commented Nov 22, 2018

* copy this themes list.html (see `layouts/_default/list.html`) to the layouts folder in your projects root

* rename this copied list.html to index.html

hello @lgaida ,

I did this, and it works, thanks. However, I get these warnings:

WARNING: calling IsSet with unsupported type "string" (string) will always return false.

WARNING: Page's .Prev is deprecated and will be removed in a future release. Use .NextPage (yes, not .PrevPage).

WARNING: Page's .Next is deprecated and will be removed in a future release. Use .PrevPage (yes, not .NextPage).

I also notice that:

  • no links to tags or categories are generated below each post
  • the "Explore" section at the bottom of the page is empty (is that the one where tags should appear?)

Is the behaviour above related to the warnings I see, or should I set some other variable?

Thanks

@mfioretti
Copy link
Author

@mfioretti mfioretti commented Nov 23, 2018

I confirm that, while your fix for the home page is working, this part is not, and so this issue is not really closed:

hello @lgaida ,

I did this, and it works, thanks. However, I get these warnings:

WARNING: calling IsSet with unsupported type "string" (string) will always return false.

WARNING: Page's .Prev is deprecated and will be removed in a future release. Use .NextPage (yes, not .PrevPage).

WARNING: Page's .Next is deprecated and will be removed in a future release. Use .PrevPage (yes, not .NextPage).

I also notice that:

no links to tags or categories are generated below each post
the "Explore" section at the bottom of the page is empty (is that the one where tags should appear?)

Is the behaviour above related to the warnings I see, or should I set some other variable?

@lgaida
Copy link
Owner

@lgaida lgaida commented Nov 27, 2018

hello again @mfioretti ,
i will fix the warnings soon and no, they are not the reason why the tags don't show.
The "Explore" section is where the tags should show up. Take a look at the config and the post-files in the demo sources.

@mfioretti
Copy link
Author

@mfioretti mfioretti commented Dec 2, 2018

hello again @mfioretti ,
i will fix the warnings soon and no, they are not the reason why the tags don't show.
The "Explore" section is where the tags should show up. Take a look at the config and the post-files in the demo sources.

I have realized why the tags did not show. In the jumbotron.html file you say "tags" (plural) instead of "tag", which is THE label for tags in all the other Hugo templates I have seen and used so far. Why? It would make so much sense to use the same labeling.

When I realized this, I just changed myself ALL the occurrences of "tags" to "tag" in jumbotron.html . At that point tags did show up, but causing two other problems:

  1. as is, jumbotron.html shows ALL the tags of the whole site, in each page. When a site has lots of tags, like mine, they cover the text of the post.
  2. what I want underneath each post is only a list of the tags for THAT specific post

for these two reasons, I have just commented out jumbotron.html for now. Point 2 above is my need only, so if you can suggest how to fix it, thanks! If not, no problem, I will ask on the Hugo forum. Point 1 instead is something that will affect everybody who has more than some tens of tags, so you may want to fix it to keep the theme more widely usable.

@lgaida
Copy link
Owner

@lgaida lgaida commented Dec 3, 2018

The jumbotron is supposed to show ALL tags. The actual tags of a specific post are shown directly under the text of your post but slighlty above the jumbotron.
See https://lgaida.github.io/mediumish-gohugo-theme-demo/blog/eighth/
where the tag "interesting" is listed directly under the post (specific), and the tags "drink" and "interesting" are shown in the jumbotron (all tags available).

Luckily you can override the themes layouts with your custom project layouts, as we already have discussed earlier 👍

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

Successfully merging a pull request may close this issue.

None yet
2 participants