1bl4z3r / hermit-V2

Continuing Hermit's legacy to be minimal and fast theme
https://1bl4z3r.github.io/hermit-V2/
MIT License
79 stars 33 forks source link

Unintended side effect of `[params.author]` #42

Closed jamesbraza closed 10 months ago

jamesbraza commented 10 months ago

The fix in https://github.com/1bl4z3r/hermit-V2/commit/556699fcd783d9803ada8b7cd7c908a7eb7e362c has a side effect, which is my site starts using the hermit-V2's about option from the repo's hugo.toml: https://github.com/1bl4z3r/hermit-V2/blob/556699fcd783d9803ada8b7cd7c908a7eb7e362c/hugo.toml#L41

It leads to this error:

> hugo server -D
...
hugo v0.120.3-a4892a07b41b7b3f1f143140ee4ec0a9a5cf3970+extended darwin/arm64 BuildDate=2023-11-01T17:57:00Z VendorInfo=gohugoio

ERROR [en] REF_NOT_FOUND: Ref "about-hugo" from page "posts/post-title.md": page not found

The issue arises because my About post in content/ is not named about-hugo, it's just named about.

Fix option 1 (falls onto users): when migrating to [params.author], one has to override both name and about:

[params.author]
name = "James Braza"
about = "about"

Fix option 2 (falls onto hermit-v2): removing the [params.author] section from the main branch's hugo.toml

What do you think? I am not sure which is the better route.

1bl4z3r commented 10 months ago

Hi @jamesbraza,

Editing 'hugo.toml' is evident if user wants flexibility and customization (which is the themes' motto).

A user should create a hugo.toml for his site in root.

I had never thought of this. So, in next push, I thinking to rename 'hugo.toml' to 'hugo.toml.example', so that a user have to create a 'hugo.toml'.

Let me know if this is acceptable, as about page could be different for all users, and it would be stupid of me if I should omit this crucial section.

jamesbraza commented 10 months ago

Yeah I like what you suggest, it ensures:

Feel free to go down that route


An alternate solution could be a hugo.toml with more generalized defaults. Perhaps the most generalized default is not specifying the fields within params.author. For example you could rely on the user to read Explaining Configs, or have the repo's hugo.toml be:

[params.author]
# about = "replace-me"
# name = "Replace Me"
1bl4z3r commented 10 months ago

What I'm thinking. I will remove hugo.toml which is used to generate the Demo site and add a new file called "hugo.toml.example".

There, I'll either comment out everything or put in default Replace Me values, and a link to Demosite's hugo.toml where user can see how that value is populated.

1bl4z3r commented 10 months ago

Added hugo.toml.example in place of hugo.toml with additional help on how to setup, so unless you have a hugo.toml in root, theme will not compile

jamesbraza commented 10 months ago

Nice job! Looks like my site still works after this change 👌

An aside is it may good to go with staging branch's readTimeSeparator, I feel like that default is generalized

1bl4z3r commented 10 months ago

Yep, readTimeSeparator is meant to be changed. You may copy from staging's toml, I'm not gonna stop you 😂😂