Skip to content

Conversation

@john-sp
Copy link
Member

@john-sp john-sp commented Jun 16, 2025

Allows for embeds (on discord and others) to work, also helps with SEO

Allows for embeds (on discord and others) to work
@github-actions
Copy link

🚀 Draft Preview: http://pr137.drafts.lczero.org/

@github-actions
Copy link

🚀 Draft Preview: http://pr137.drafts.lczero.org/

config.toml Outdated
meta_og_title = "Leela Chess Zero"
meta_og_type = "website"
meta_og_url = "https://lczero.org"
meta_og_image = "https://raw.githubusercontent.com/JugglerX/hugo-whisper-theme/master/images/tn.png"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what meta_og_image is, but likely we don't what this particular image?

@mooskagh mooskagh requested a review from Copilot June 17, 2025 08:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds Open Graph and Twitter metadata to the site’s head for better embeds and SEO

  • Introduces a new opengraph.html partial with various OG/Twitter tags
  • Injects the new partial into the main head.html layout
  • Updates site parameters in config.toml and refines the blog index title

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
themes/leela/layouts/_partials/head/opengraph.html New partial defining Open Graph and Twitter meta tags
themes/leela/layouts/_partials/head.html Includes the head/opengraph.html partial
content/blog/_index.md Refines the blog section’s title
config.toml Enables and configures homepage_meta_tags params

Comment on lines 4 to 8
{{- with or site.Title site.Params.title | plainify }}
<meta property="og:site_name" content="{{ . }}">
{{- end }}

{{- with or .Title site.Title site.Params.title | plainify }}
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template uses site.Title and site.Params.title without the leading dot, so Hugo won’t resolve these. Update to .Site.Title and .Site.Params.title to correctly reference site parameters.

Suggested change
{{- with or site.Title site.Params.title | plainify }}
<meta property="og:site_name" content="{{ . }}">
{{- end }}
{{- with or .Title site.Title site.Params.title | plainify }}
{{- with or .Site.Title .Site.Params.title | plainify }}
<meta property="og:site_name" content="{{ . }}">
{{- end }}
{{- with or .Title .Site.Title .Site.Params.title | plainify }}

Copilot uses AI. Check for mistakes.
<meta property="og:site_name" content="{{ . }}">
{{- end }}

{{- with or .Title site.Title site.Params.title | plainify }}
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace site.Title with .Site.Title here to ensure the site title is properly referenced in the OG title and avoid template errors.

Suggested change
{{- with or .Title site.Title site.Params.title | plainify }}
{{- with or .Title .Site.Title site.Params.title | plainify }}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,81 @@
{{/* Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_partials/opengraph.html */}}
<meta property="og:url" content="{{ .Site.Params.homepage_meta_tags.meta_og_url }}">
Copy link

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OG image meta tag is missing; add <meta property="og:image" content="{{ .Site.Params.homepage_meta_tags.meta_og_image }}"> after this line so social previews include the configured image.

Suggested change
<meta property="og:url" content="{{ .Site.Params.homepage_meta_tags.meta_og_url }}">
<meta property="og:url" content="{{ .Site.Params.homepage_meta_tags.meta_og_url }}">
<meta property="og:image" content="{{ .Site.Params.homepage_meta_tags.meta_og_image }}">

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

🚀 Draft Preview: http://pr137.drafts.lczero.org/

@mooskagh mooskagh merged commit 263fbb1 into LeelaChessZero:master Jun 18, 2025
1 check passed
@john-sp john-sp deleted the opengraph branch July 7, 2025 15:56
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.

2 participants