-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[FEATURE] new opengraph 'fediverse:creator' meta #1619
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
Conversation
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 |
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. |
@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? |
I'm saying that this should be implemented at the theme or site level. |
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. |
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 |
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:
Is one of these better than the others? No; it depends on what the site or theme author has in mind. |
Yet another reason for handling this at the theme or site level. |
True |
I'll try to figure that out next week. Meanwhile I'll convert this PR to draft. Thank you both for the discussion! |
76cc50b
to
c9d8daf
Compare
|
@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. |
The mentioned article is from 2024-07-02 says:
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.
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. |
c9d8daf
to
52a0872
Compare
|
@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. |
All checks passed - time to implement? |
52a0872
to
044cf44
Compare
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 |
... based on the fediverseCreator param of the post defaulting on the site.
044cf44
to
784cf66
Compare
Right that seems to be missing, 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. |
|
Usage: Site level: params:
social:
fediverse_creator: "@adityatelange@mastodon.social" Page (Overrides Site level value): ---
title: "My Page"
social:
fediverse_creator: "@adityatelange@mastodon.social"
--- |
**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>
* 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>
**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>
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:
Page (Overrides Site level value):
PR Checklist