lgaida / mediumish-gohugo-theme

A mediumish gohugo theme, ported from jekyll
MIT License
131 stars 99 forks source link

home page at wrong URL, many sections missing #3

Closed mfioretti closed 6 years ago

mfioretti commented 6 years ago

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 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 commented 6 years ago

Hi @mfioretti

I recommend reading the README again.

mfioretti commented 6 years ago

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 commented 6 years ago

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:

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 commented 5 years ago

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

mfioretti commented 5 years ago
* 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:

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

Thanks

mfioretti commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 :+1: