Fix URL used for images in twitter/og previews (#19989)

* Fix URL used for images in twitter/og previews

* Use absURL to create absolute URLs for meta tag URLs

* Update other uses of base URL generation to use absURL helper
This commit is contained in:
Michael Irwin 2024-05-08 03:07:42 -04:00 committed by GitHub
parent 0349f806c6
commit efadb1fdcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@
<!-- favicon -->
{{ partialCached "favicon.html" "favicon" }}
<!-- make the latest API version the canonical page as that's what we want users to be using mostly -->
<link rel="canonical" href="{{ site.BaseURL }}/docker-hub/api/latest/" />
<link rel="canonical" href="{{ "/docker-hub/api/latest/" | relURL }}" />
<style>
body {
margin: 0;

View File

@ -2,7 +2,7 @@
User-agent: *
Sitemap: {{ site.BaseURL }}/sitemap.xml
Sitemap: {{ "sitemap.xml" | absURL }}
{{- else -}}
# Disable all indexing on staging websites and Netlify previews to prevent
# them showing up in search results.

View File

@ -35,7 +35,7 @@
<meta name="twitter:url" content="https://twitter.com/docker_docs" />
<meta
name="twitter:image:src"
content="{{ site.BaseURL }}/assets/images/thumbnail.webp"
content="{{ "assets/images/thumbnail.webp" | absURL }}"
/>
<meta name="twitter:image:alt" content="Docker Documentation" />
<meta property="og:title" content="{{ $title }}" />
@ -49,7 +49,7 @@
<meta
property="og:image"
itemprop="image primaryImageOfPage"
content="{{ site.BaseURL }}/assets/images/thumbnail.webp"
content="{{ "assets/images/thumbnail.webp" | absURL }}"
/>
<meta property="og:locale" content="en_US" />
<meta property="og:url" content="{{ .Permalink }}" />