Fix transformHead
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m2s

This commit is contained in:
thepaperpilot 2024-08-09 08:25:09 -05:00
parent 7e55a8c0b9
commit 1d40312517

View file

@ -62,10 +62,10 @@ export default {
if (context.pageData.relativePath.startsWith("garden")) {
context.head.push(["meta", { name: "og:type", content: "article" }]);
context.head.push(["meta", { name: "article:author", content: "https://www.thepaperpilot.org/about" }]);
const published = context.content.match(/<time class='dt-published' datetime='[^']+'>([0-9-]+)<\/time>/)[1];
const updated = context.content.match(/<time class='dt-updated' datetime='[^']+'>([0-9-]+)<\/time>/)[1];
context.head.push(["meta", { name: "article:published_time", content: published }]);
context.head.push(["meta", { name: "article:modified_time", content: updated }]);
const published = context.content.match(/<time class="dt-published" datetime="[^']+">([0-9-]+)<\/time>/)?.[1];
if (published) context.head.push(["meta", { name: "article:published_time", content: published }]);
const updated = context.content.match(/<time class="dt-updated" datetime="[^']+">([0-9-]+)<\/time>/)?.[1];
if (updated) context.head.push(["meta", { name: "article:modified_time", content: updated }]);
}
},
lastUpdated: false,