1bl4z3r / hermit-V2

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

[BUG] - No site name specified in home page #98

Closed xuhdev closed 3 weeks ago

xuhdev commented 4 weeks ago

Describe the bug Google primarily relies on the WebSite structured data to understand the name of the site. Hermit generates no such structured data.

Expected behavior Such a WebSite structured data should be generated.

Additional context

This is relatively straightforward to implement. Check out:

https://github.com/8hobbies/KamiMod/blob/7a7bcfa5c4c0d3332f0734bf1e8cfe80e992d484/layouts/partials/templates/schema_json.html#L1-L12

(You can skip the alternateName part and use the rest)

1bl4z3r commented 4 weeks ago

Hi @xuhdev,

Can you please help me understand below points:-

  1. Is this related to Sitemap, or a separate schema which needs to be added?
  2. What information should be provided, or any other resources which I can refer to understand?
  3. Can I "take inspiration" from schema_json.html? XD

Please help to understand so that I can work on it.

xuhdev commented 3 weeks ago
  1. It's a separate schema.
  2. The name of the site, and the homepage URL. Technical reference: https://developers.google.com/search/docs/appearance/site-names#website
  3. Absolutely! While I wrote the WebSite structured data, the rest are mostly inherited from PaperMod.
1bl4z3r commented 3 weeks ago

Thanks @xuhdev,

I will get to work right away. Expect a new release on Monday/Tuesday.

Till then I'm keeping this issue opened.

1bl4z3r commented 3 weeks ago

Hi @xuhdev,

Can you check if schema is properly applied for your site, or are there any new fields which could've been added.

xuhdev commented 3 weeks ago

I found this line causes errors since site.params.author.about is not an URL:

https://github.com/1bl4z3r/hermit-V2/blob/08f71a29ebfca8e580eac8f236528992650c9889/layouts/partials/webschema.html#L51

1bl4z3r commented 3 weeks ago

Oh yes. This refers to these lines in hugo.tomlhttps://github.com/1bl4z3r/hermit-V2/blob/08f71a29ebfca8e580eac8f236528992650c9889/hugo.toml.example#L56-L58

Find detailed writeup here #support-for-guest-authors

If there is a page in content with same name as about. It can be easily linked.

However, I would like to know how would you like this to be implemented, or should it be completely ignored if about is not present?

xuhdev commented 3 weeks ago

Yeah I think it should be ignored if there's no about. Sorry I missed the relevant doc.

Additionally, the URL field shouldn't be there because it's not part of the Person schema: https://schema.org/Person Instead, the field should be identifier.

1bl4z3r commented 3 weeks ago

That is specifically related to Article object. Link - #article-types

author.url is the part of that schema.

Still, I'm pushing out a fix

1bl4z3r commented 3 weeks ago

Fix pushed. Let me know if you are facing any issues and/or there are complications with schema checkers

xuhdev commented 3 weeks ago

It works now, thanks!

A minor suggestion but it's certainly up to you:

https://github.com/1bl4z3r/hermit-V2/blob/a01afdd69a7dfc2cd5c2813e2b324046f68effe6/hugo.toml.example#L58

This line is not a URL and causes build failure if anyone comes by and use the example as a starting point. I would recommend commenting it out by default or replace the value to https://example.com :)

1bl4z3r commented 3 weeks ago

My thinking was to create an about page in /content. E.g. about-author.md. This could be linked as about for the author. This doesn't link to external uri.

More often than not, most of the sites will have an about page, so why not provide a QoL for them to link their about page.

Still, you are free to omit it. I will check again if there's a hard dependency on it.

For now, I'm closing this issue. See you again