Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,15 @@ summaryLength = 30
## You can enable to add anchor links to header elements
# enable_anchor_link = true

# [params.homepage_meta_tags]
# meta_description = "Leela Chess Zero is an open source neural network based chess engine."
# meta_og_title = "Leela Chess Zero"
# meta_og_type = "website"
# meta_og_url = "https://hugo-whisper.netlify.com"
# meta_og_image = "https://raw.githubusercontent.com/JugglerX/hugo-whisper-theme/master/images/tn.png"
# meta_og_description = "Hugo Whisper is a documentation theme built with Hugo."
# meta_twitter_card = "summary"
# meta_twitter_site = "@zerostaticio"
# meta_twitter_creator = "@zerostaticio"
[params.homepage_meta_tags]
meta_description = "Leela Chess Zero is an open source neural network based chess engine."
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?

meta_og_description = "Leela Chess Zero is an open source neural network based chess engine."
meta_twitter_card = "summary"
meta_twitter_site = "@leelachesszero"

[params.logo]
mobile = "/images/logo.svg"
Expand Down
2 changes: 1 addition & 1 deletion content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Blog"
title: "Leela Chess Zero Blog"
date: 2019-12-07T19:59:42+01:00
draft: false
weight: 100
Expand Down
1 change: 1 addition & 0 deletions themes/leela/layouts/_partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
{{ partial "head/opengraph.html" . }}
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}
{{ if .Param "math" }}
Expand Down
81 changes: 81 additions & 0 deletions themes/leela/layouts/_partials/head/opengraph.html
Original file line number Diff line number Diff line change
@@ -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.

{{- 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.
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.
<meta property="og:title" content="{{ . }}">
{{- end }}

{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
<meta property="og:description" content="{{ trim . "\n\r\t " }}">
{{- end }}

{{- with or .Params.locale site.Language.LanguageCode }}
<meta property="og:locale" content="{{ replace . `-` `_` }}">
{{- end }}

{{- with or .Title site.Title site.Params.title | plainify }}
<meta name="twitter:title" content="{{ . }}">
{{- end }}

{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape }}
<meta name="twitter:description" content="{{ trim . "\n\r\t " }}">
{{- end }}


<meta name="twitter:site" content="{{ .Site.Params.homepage_meta_tags.meta_twitter_site }}" />
<meta name="twitter:card" content="{{ .Site.Params.homepage_meta_tags.meta_twitter_card }}" />

{{- if .IsPage }}
<meta property="og:type" content="article">
{{- with .Section }}
<meta property="article:section" content="{{ . }}">
{{- end }}
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }}
<meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- with .Lastmod }}
<meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- range .GetTerms "tags" | first 6 }}
<meta property="article:tag" content="{{ .Page.Title | plainify }}">
{{- end }}
{{- else }}
<meta property="og:type" content="website">
{{- end }}

{{- with .Params.audio }}
{{- range . | first 6 }}
<meta property="og:audio" content="{{ . | absURL }}">
{{- end }}
{{- end }}

{{- with .Params.videos }}
{{- range . | first 6 }}
<meta property="og:video" content="{{ . | absURL }}">
{{- end }}
{{- end }}

{{- range .GetTerms "series" }}
{{- range .Pages | first 7 }}
{{- if ne $ . }}
<meta property="og:see_also" content="{{ .Permalink }}">
{{- end }}
{{- end }}
{{- end }}

{{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- with .facebook_app_id }}
<meta property="fb:app_id" content="{{ . }}">
{{- else }}
{{- with .facebook_admin }}
<meta property="fb:admins" content="{{ . }}">
{{- end }}
{{- end }}
{{- end }}
{{- end }}