Proposed PR for OpenGraph Support for better integration with other websites #205
Replies: 4 comments 5 replies
-
Hi, there is already a opengraph integration available in Hugo, see e.g. https://github.com/thegeeklab/hugo-geekblog/blob/main/layouts/partials/head/microformats.html#L1 |
Beta Was this translation helpful? Give feedback.
-
Official docs https://gohugo.io/templates/internal/#open-graph |
Beta Was this translation helpful? Give feedback.
-
Thanks again, sorry for the noise! |
Beta Was this translation helpful? Give feedback.
-
Thank you. Open Graph is working great for me with the microformats addition. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm planning to add OpenGraph support to my GeekDoc-based website, and would like to know if there is interest by the developers (e.g. @xoxys) in my doing this in the style of the rest of the theme for upstreaming, or if this is something that I would maintain for myself only.
There are two parts to the idea. The first is the OpenGraph part which has no visible effect on the theme, it just adds metadata in the <head> section (although with a .Site.Params.geekDocOpenGraphEnable / .page.Params.geekDocOpenGraphEnable check or such) using either the Hugo internal template for that, or a template based on the one from Hugo).
The advantage of OpenGraph is that forums like Discourse, as well as other sites, can use the supplied metadata and image (which can be a site-wide default, a per-page cover image is not required, but an image is required by the OpenGraph spec) to create a more appealing 'card' instead of 'just a link' to a page or article on one's site.
The other question is, if you have per-page images for OpenGraph, how (or whether) to display them (by default subject to an override or not by default by enabled by an override on some pages) on the page itself, without adding the image explicitly in the page markdown (or shortcode), or at least to have a shortcode with the same logic as the OpenGraph template for adding the image in a suitable place 'manually'.
The problem with images is how much effort to put in the rendering (e.g. responsive, converting format, sizing, etc).
So, I'm posting here for thoughts on the best way to approach this for GeekDoc (or to just do my own thing).
Beta Was this translation helpful? Give feedback.
All reactions