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

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

David-Guillot
Copy link

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

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

@adityatelange
Copy link
Owner

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
Copy link
Contributor

jmooring commented Nov 8, 2024

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
Copy link
Author

@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
Copy link
Contributor

jmooring commented Nov 8, 2024

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

@adityatelange
Copy link
Owner

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
Copy link
Owner

adityatelange commented Nov 8, 2024

@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
Copy link
Contributor

jmooring commented Nov 8, 2024

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
Copy link
Contributor

jmooring commented Nov 8, 2024

but a mapping of each authors fediverse id

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

@adityatelange
Copy link
Owner

but a mapping of each authors fediverse id

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

True

@David-Guillot
Copy link
Author

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!

@David-Guillot David-Guillot marked this pull request as draft November 8, 2024 20:37
@David-Guillot David-Guillot force-pushed the feat/html-meta-fediverse-creator branch from 62961e9 to 76cc50b Compare November 8, 2024 20:38
... based on the fediverseCreator param of the post defaulting on the site.
@David-Guillot David-Guillot force-pushed the feat/html-meta-fediverse-creator branch from 76cc50b to c9d8daf Compare November 12, 2024 09:40
@David-Guillot
Copy link
Author

David-Guillot commented Nov 12, 2024

@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.

@Syphdias
Copy link
Contributor

The mentioned article is from 2024-07-02 says:

If multiple tags are present on the page, the first one will be displayed, but we may add support for showing multiple authors in the future.

This is very vague and might be never. The following sentence about "coming weeks" is not about multiple authors but about the single creator attribution they just announced for Mastodon.

We intend to propose a specification draft for other ActivityPub platforms in the coming weeks.

I think there is no use on waiting for a new spec unless there is already a draft of the spec with multiple author attribution somewhere.

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

Successfully merging this pull request may close these issues.

[Enhancement]: HTML meta "fediverse:creator"
4 participants