Skip to content

Commit f970e0c

Browse files
committed
docs: fix og headers
1 parent a11d598 commit f970e0c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.vitepress/config.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ function resolveHref(href: string, withDomain: boolean = false): string {
6868
}
6969

7070
const defaultImageMetaTags: HeadConfig[] = [
71-
["meta", {name: "og:image", content: socialPosterLink}],
72-
["meta", {name: "og:image:width", content: "4096"}],
73-
["meta", {name: "og:image:height", content: "2048"}],
71+
["meta", {property: "og:image", content: socialPosterLink}],
72+
["meta", {property: "og:image:width", content: "4096"}],
73+
["meta", {property: "og:image:height", content: "2048"}],
7474
["meta", {name: "twitter:image", content: socialPosterLink}],
7575
["meta", {name: "twitter:card", content: "summary_large_image"}]
7676
];
@@ -187,9 +187,9 @@ export default defineConfig({
187187
["link", {rel: "alternate", title: "Blog", type: "application/atom+xml", href: resolveHref("/blog/feed.atom", true)}],
188188
["meta", {name: "theme-color", content: "#cd8156"}],
189189
["meta", {name: "theme-color", content: "#dd773e", media: "(prefers-color-scheme: dark)"}],
190-
["meta", {name: "og:type", content: "website"}],
191-
["meta", {name: "og:locale", content: "en"}],
192-
["meta", {name: "og:site_name", content: "node-llama-cpp"}],
190+
["meta", {property: "og:type", content: "website"}],
191+
["meta", {property: "og:locale", content: "en"}],
192+
["meta", {property: "og:site_name", content: "node-llama-cpp"}],
193193
["script", {async: "", src: "https://www.googletagmanager.com/gtag/js?id=G-Q2SWE5Z1ST"}],
194194
[
195195
"script",
@@ -223,7 +223,7 @@ export default defineConfig({
223223
const coverImage = await ensureLocalImage(pageData.frontmatter.image, "cover", {
224224
baseDestLocation: imageDir.split("/")
225225
});
226-
head.push(["meta", {name: "og:image", content: resolveHref(coverImage.urlPath.absolute, true)}]);
226+
head.push(["meta", {property: "og:image", content: resolveHref(coverImage.urlPath.absolute, true)}]);
227227
} else if (typeof pageData.frontmatter.image === "object") {
228228
const coverImage = typeof pageData.frontmatter.image.url === "string"
229229
? await ensureLocalImage(pageData.frontmatter.image.url, "cover", {
@@ -233,19 +233,19 @@ export default defineConfig({
233233

234234
if (typeof pageData.frontmatter.image.url === "string")
235235
head.push(["meta", {
236-
name: "og:image",
236+
property: "og:image",
237237
content: resolveHref(coverImage?.urlPath.absolute ?? pageData.frontmatter.image.url, true)
238238
}]);
239239

240240
if (pageData.frontmatter.image.width != null)
241241
head.push(["meta", {
242-
name: "og:image:width",
242+
property: "og:image:width",
243243
content: String(coverImage?.width ?? pageData.frontmatter.image.width)
244244
}]);
245245

246246
if (pageData.frontmatter.image.height != null)
247247
head.push(["meta", {
248-
name: "og:image:height",
248+
property: "og:image:height",
249249
content: String(coverImage?.height ?? pageData.frontmatter.image.height)
250250
}]);
251251
}
@@ -273,9 +273,9 @@ export default defineConfig({
273273
}
274274
}
275275

276-
head.push(["meta", {name: "og:title", content: title}]);
276+
head.push(["meta", {property: "og:title", content: title}]);
277277
if (description != null && description !== "")
278-
head.push(["meta", {name: "og:description", content: description}]);
278+
head.push(["meta", {property: "og:description", content: description}]);
279279

280280
head.push(["meta", {name: "twitter:title", content: title}]);
281281
if (description != null && description !== "")

0 commit comments

Comments
 (0)