Fix transformHead
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m2s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m2s
This commit is contained in:
parent
7e55a8c0b9
commit
1d40312517
1 changed files with 4 additions and 4 deletions
|
@ -62,10 +62,10 @@ export default {
|
||||||
if (context.pageData.relativePath.startsWith("garden")) {
|
if (context.pageData.relativePath.startsWith("garden")) {
|
||||||
context.head.push(["meta", { name: "og:type", content: "article" }]);
|
context.head.push(["meta", { name: "og:type", content: "article" }]);
|
||||||
context.head.push(["meta", { name: "article:author", content: "https://www.thepaperpilot.org/about" }]);
|
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 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];
|
if (published) context.head.push(["meta", { name: "article:published_time", content: 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];
|
||||||
context.head.push(["meta", { name: "article:modified_time", content: updated }]);
|
if (updated) context.head.push(["meta", { name: "article:modified_time", content: updated }]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lastUpdated: false,
|
lastUpdated: false,
|
||||||
|
|
Loading…
Reference in a new issue