aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/templates/tag.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src/templates/tag.ts')
-rw-r--r--nuldoc-src/templates/tag.ts28
1 files changed, 14 insertions, 14 deletions
diff --git a/nuldoc-src/templates/tag.ts b/nuldoc-src/templates/tag.ts
index a53e59d..8c296d8 100644
--- a/nuldoc-src/templates/tag.ts
+++ b/nuldoc-src/templates/tag.ts
@@ -22,15 +22,15 @@ export default async function convertTag(
): Promise<Document> {
const tagLabel = (config.blog.tagLabels as { [key: string]: string })[tag];
- const doc = {
- root: el("__root__", []),
- sourceFilePath: `<tag:${tag}>`,
- link: `/tags/${tag}/`,
- title: tagLabel,
- summary: `タグ「${tagLabel}」のついた記事一覧`,
- tags: [],
- revisions: [],
- };
+ const doc = new Document(
+ el("__root__", []),
+ `<tag:${tag}>`,
+ `/tags/${tag}/`,
+ tagLabel,
+ `タグ「${tagLabel}」のついた記事一覧`,
+ [],
+ [],
+ );
const headChildren = [
metaElement([["charset", "UTF-8"]]),
@@ -42,7 +42,7 @@ export default async function convertTag(
metaElement([["name", "copyright"], [
"content",
`&copy; ${
- posts[posts.length - 1].revisions[0].date.substring(0, 4)
+ posts[posts.length - 1].getCreatedDate().substring(0, 4)
} ${config.blog.author}`,
]]),
metaElement([["name", "description"], [
@@ -117,16 +117,16 @@ export default async function convertTag(
text("Posted on"),
el(
"time",
- [["datetime", post.revisions[0].date]],
- text(post.revisions[0].date),
+ [["datetime", post.getCreatedDate()]],
+ text(post.getCreatedDate()),
),
...(post.revisions.length > 1
? [
text(", updated on "),
el("time", [[
"datetime",
- post.revisions[post.revisions.length - 1].date,
- ]], text(post.revisions[post.revisions.length - 1].date)),
+ post.getUpdatedDate(),
+ ]], text(post.getUpdatedDate())),
]
: []),
),