Skip to content

Conversation

David-Guillot
Copy link
Contributor

@David-Guillot David-Guillot commented Oct 17, 2024

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 #1642

Usage

Site level:

params:
  social:
    fediverse_creator: "@adityatelange@mastodon.social"
    twitter: adityatelange

Page (Overrides Site level value):

---
title: "My Page"
social:
  fediverse_creator: "@adityatelange@mastodon.social"
---

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
Contributor 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
Contributor 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 2 times, most recently from 76cc50b to c9d8daf Compare November 12, 2024 09:40
Copy link

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

@David-Guillot David-Guillot force-pushed the feat/html-meta-fediverse-creator branch from c9d8daf to 52a0872 Compare January 6, 2025 16:26
Copy link

sonarqubecloud bot commented Jan 6, 2025

@David-Guillot
Copy link
Contributor Author

David-Guillot commented Jan 6, 2025

@adityatelange what are your thoughts on this, two months later? I think @Syphdias is right: multiple authors are nowhere near landing on Mastodon. But many bloggers would benefit from this PR.

@joerglohrer
Copy link

All checks passed - time to implement?

@David-Guillot David-Guillot force-pushed the feat/html-meta-fediverse-creator branch from 52a0872 to 044cf44 Compare February 12, 2025 16:03
@David-Guillot David-Guillot marked this pull request as ready for review February 12, 2025 16:04
@adityatelange
Copy link
Owner

@adityatelange what are your thoughts on this, two months later? I think @Syphdias is right: multiple authors are nowhere near landing on Mastodon. But many bloggers would benefit from this PR.

Yes. #1642 looks much simpler patch to me. We can go ahead with this.

@jmooring would you be open to integrate #1642 to hugo's internal templates as well. Since we have fb:app_id and fb:admins which are also similar proprietary meta tags unrelated to opengraph protocol.

@David-Guillot
Copy link
Contributor Author

Yeah I don't see much difference between #1642 and this one (this one just allows defining an author at site-level and one at post-level, which I thought was a good idea), but it you prefer #1642 let's go for it, because I really think this feature is a must-have for many users!

... 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 044cf44 to 784cf66 Compare March 1, 2025 14:13
@adityatelange
Copy link
Owner

adityatelange commented Mar 1, 2025

Right that seems to be missing, I'll add something for that.

Looks like everywhere hugo is using global params only https://gohugo.io/templates/embedded/#open-graph

I think I'll extend twitter one in future. Let's go with this change first.

Copy link

sonarqubecloud bot commented Mar 1, 2025

@adityatelange
Copy link
Owner

adityatelange commented Mar 1, 2025

Usage:

Site level:

params:
  social:
    fediverse_creator: "@adityatelange@mastodon.social"

Page (Overrides Site level value):

---
title: "My Page"
social:
  fediverse_creator: "@adityatelange@mastodon.social"
---

@adityatelange adityatelange merged commit e2e1011 into adityatelange:master Mar 1, 2025
2 checks passed
@David-Guillot David-Guillot deleted the feat/html-meta-fediverse-creator branch March 1, 2025 15:21
Yurzi pushed a commit to Yurzi/hugo-PaperMod that referenced this pull request May 1, 2025
**Usage**

Site level:

params:
  social:
    fediverse_creator: "@username@mastodon.social"

Page (Overrides Site level value):

---
title: "My Page"
social:
  fediverse_creator: "@username@mastodon.social"
---


Closes adityatelange#1618 adityatelange#1642

---------

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
vikas-0 added a commit to vikas-0/hugo-PaperMod that referenced this pull request Jul 19, 2025
* improve Toc

* i18n: adds Occitan language (adityatelange#1539)

* Update Turkish translation (adityatelange#1564)

Fix a typo and improve the translation

* Update bug report template to use GitHub's form schema

* Update enhancement issue template to use GitHub's form schema

* Add a social icon for Dzen (adityatelange#1599)

* Add a social icon for Wikipedia (adityatelange#1600)

* Use new 'Image render hook' template from Hugo. (adityatelange#1526)

* Pull render-image template from Hugo
https://github.com/gohugoio/hugo/commits/master/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html

cloned at b893a09aa62c01a62e32b0effdb02e86b51d46d6

* Add loading=lazy attribute

adityatelange@c353447

* Update minimum required Hugo version to 0.125.7

* Update GitHub Actions workflows to use latest versions of dependencies

* [PATCH] hugolib: Deprecate site methods Author, Authors, and Social

cherry-picked from gohugoio/hugo@d4d49e0

* [PATCH] tpl/tplimpl: Remove trailing slash from void elements

cherry-picked from gohugoio/hugo@2f7df4b

* Update translations for he.yaml (adityatelange#1594)

* Replace thumbnailUrl with logo for json schema (adityatelange#1488)

thumbnailUrl is not part of Organization: https://schema.org/Organization

* JSON Schema uses 'image' for a Person and 'logo' for an Organization.

* [PATCH] tpl/tplimpl: Improve embedded opengraph template

Changes:

- Add tags per documentation
- Prefer site.Title over site.Params.title
- Plainify titles, tags, and descriptions
- Add fallback values for locale
- Fix pages related by series
- Improve readability

Co-authored-by: tomy0000000 <git@tomy.me>
Co-authored-by: sean-au <sean@powerfulwebdesign.com.au>

* Re-add support for cover images in OpenGraph

4a4d0c0

* [PATCH] tpl/tplimpl: Fix double-escaping in opengraph template

cherry-picked from gohugoio/hugo@fb51b69

* Update PaperMod version to v8+ in license.css and license.js

* Update LICENSE
Add current year 2025

* chore: remove obsolete polywork icon (adityatelange#1677)

The service has been shutdown as of 2025-01-31 and is no more

See https://deepnewz.com/startups/polywork-irish-startup-backed-stripe-collison-brothers-to-shut-down-560973fe

* Fix typos in github templates (adityatelange#1673)

* Fix typos in ISSUE_TEMPLATE

* Remove redundant space in pull request template

* Add social icon for Bookwyrm (adityatelange#1681)

* add farcaster logo to social icons (adityatelange#1686)

* Add social icon for Forgejo (adityatelange#1684)

* Improve style consistency of Bluesky SVG icon (adityatelange#1679)

* Add aria-label to theme toggle button for accessibility (adityatelange#1669)

* feat: add svg icon for linktree (adityatelange#1652)

* Add Whatsapp icon to social icons (adityatelange#1531)

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>

* Add social icon for Jamendo (adityatelange#1685)

Co-authored-by: PepeV_nRT <153303346+pepev-nrt@users.noreply.github.com>

* Add social icon for Nextcloud (adityatelange#1683)

* [FEATURE] new opengraph 'fediverse:creator' meta (adityatelange#1619)

**Usage**

Site level:

params:
  social:
    fediverse_creator: "@username@mastodon.social"

Page (Overrides Site level value):

---
title: "My Page"
social:
  fediverse_creator: "@username@mastodon.social"
---


Closes adityatelange#1618 adityatelange#1642

---------

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>

* Feat/improve cover image gen (adityatelange#1628)

* Refactor cover.html

* Refactor 2

* Refactor 3

* Refactor 4

* Refactor 5

* add comments and refactor more

* Refactor cover.html to use <figcaption> for image captions

* Add comments and manage whitespace

* Remove pointer-event prevention from entry-cover image

* Add demosite link to theme.toml (adityatelange#1724)

* Implement fixes for refreshed template system for Hugo v0.146.0+ (adityatelange#1726)

* Add rel=edit attribute to change suggestion link

* Add social icon for zcal (adityatelange#1746)

* Add Finnish language translation (adityatelange#1736)

* Fix breadcumb alignment in post-single

fixes: adityatelange#1732

---------

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Co-authored-by: ensag-dev <59049879+ensag-dev@users.noreply.github.com>
Co-authored-by: Berk Elyesa Yıldırım <beryesa@sayafe.org>
Co-authored-by: Geeqla <1140778+geeqla@users.noreply.github.com>
Co-authored-by: Joe Mooring <joe.mooring@veriphor.com>
Co-authored-by: Idan Hazan <as4ny0o@gmail.com>
Co-authored-by: Hong Xu <hong@topbug.net>
Co-authored-by: tomy0000000 <git@tomy.me>
Co-authored-by: sean-au <sean@powerfulwebdesign.com.au>
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
Co-authored-by: Tim Hsiung <yutingh@synology.com>
Co-authored-by: PepeV_nRT <153303346+pepev-nrt@users.noreply.github.com>
Co-authored-by: Chris Natoli <natolichris@gmail.com>
Co-authored-by: Davide Cultrera <6017063+dabikuru@users.noreply.github.com>
Co-authored-by: Colton Loftus <70598503+C-Loftus@users.noreply.github.com>
Co-authored-by: GiggleSquid <jack.connors@protonmail.com>
Co-authored-by: misdirectionmaster <63507708+misdirectionmaster@users.noreply.github.com>
Co-authored-by: Massimo Barbieri <massimo@fsfe.org>
Co-authored-by: David Guillot <david@guillot.me>
Co-authored-by: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: James <37276661+capjamesg@users.noreply.github.com>
Co-authored-by: Anthony Accioly <1591739+aaccioly@users.noreply.github.com>
Co-authored-by: Atte <47223277+addei@users.noreply.github.com>
Razzile pushed a commit to Razzile/hugo-PaperMod that referenced this pull request Aug 1, 2025
**Usage**

Site level:

params:
  social:
    fediverse_creator: "@username@mastodon.social"

Page (Overrides Site level value):

---
title: "My Page"
social:
  fediverse_creator: "@username@mastodon.social"
---


Closes adityatelange#1618 adityatelange#1642

---------

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
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"
5 participants