adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
10.29k stars 2.73k forks source link

[FEATURE] new opengraph 'fediverse:creator' meta #1619

Open David-Guillot opened 1 month ago

David-Guillot commented 1 month ago

What does this PR change? What problem does it solve?

This PR adds support of this new Mastodon 4.3 feature for highlighting journalists and bloggers.

It does so by adding a new OpenGraph meta based on a new param which can be placed on a post or on the Hugo site.

Was the change discussed in an issue or in the Discussions before?

Closes #1618

PR Checklist

adityatelange commented 2 weeks ago

Hi @David-Guillot I think its better if we add it to hugo's templates over here. https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html

cc @jmooring

jmooring commented 2 weeks ago

This would be another opinionated change to one of Hugo's embedded templates; I am not in favor of doing this. If it were up to me I would remove Hugo's embedded opengraph template (and others) from the code base.

David-Guillot commented 2 weeks ago

@adityatelange I think I agree with you: this theme is about styling a Hugo blog, not adding features that could apply to all Hugo bolgs. I just didn't think of opening a PR to @gohugoio/hugo .

@jmooring , are you saying that porting this PR to @gohugoio/hugo is a bad idea, because it would make Hugo too specific about what the web landscape is?

How do we move forward from here?

jmooring commented 2 weeks ago

I'm saying that this should be implemented at the theme or site level.

adityatelange commented 2 weeks ago

I would remove Hugo's embedded opengraph template (and others) from the code base.

Think not of like a hugo author but a theme author. we have a feature dependency here with cover images which we cannot hot-plug into hugo's templates.

I had to overwrite embedded templates because we don't have a way to add hooks to these templates. If you have a better way of doing this please suggest. For hugo this is not a hurdle because the feature we are talking about is also a opinionated feature here.

adityatelange commented 2 weeks ago

@David-Guillot

How do we move forward from here?

I see we also support multiple authors in meta tags, so in order to have this supported we'll not just need one name but a mapping of each authors fediverse id. Is it feasible? idk

jmooring commented 2 weeks ago

In my view many of the embedded templates are, at best, opinionated examples, and should be overwritten by theme authors to achieve the desired outcome.

Over the years I've examined thousands of sites, and I have seen all of the configuration constructs below:

[params]
fediverseCreator = 'foo'

[params.social]
fediverseCreator = 'foo'

[params.social.fediverse]
creator = 'foo'

[[params.social]]
id = 'fediverse'
creator = 'foo'

[[params.social.networks]]
id = 'fediverse'
creator = 'foo'

[[params.mytheme.social.networks]]
id = 'fediverse'
creator = 'foo'

Is one of these better than the others? No; it depends on what the site or theme author has in mind.

jmooring commented 2 weeks ago

but a mapping of each authors fediverse id

Yet another reason for handling this at the theme or site level.

adityatelange commented 2 weeks ago

but a mapping of each authors fediverse id

Yet another reason for handling this at the theme or site level.

True

David-Guillot commented 2 weeks ago

I see we also support multiple authors in meta tags, so in order to have this supported we'll not just need one name but a mapping of each authors fediverse id. Is it feasible? idk

I'll try to figure that out next week. Meanwhile I'll convert this PR to draft. Thank you both for the discussion!

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

David-Guillot commented 1 week ago

@adityatelange for now, as you can see in The Technical section of Mastodon's announcement, multiple authors are not yet supported on their end.

So I just rebased this PR for now, let me know if you want to integrate this change as-is, in which case I'll set the PR ready for review.