From 7c81d7bf5bcb6fb9578ae4ae54684742bf9ae35d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 22 Feb 2024 01:51:21 +0900 Subject: feat(blog/nuldoc): implement generating Atom feed --- vhosts/blog/nuldoc-src/pages/post.ts | 6 ++++++ vhosts/blog/nuldoc-src/pages/slide.ts | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'vhosts/blog/nuldoc-src/pages') diff --git a/vhosts/blog/nuldoc-src/pages/post.ts b/vhosts/blog/nuldoc-src/pages/post.ts index 31a39c76..f7e53421 100644 --- a/vhosts/blog/nuldoc-src/pages/post.ts +++ b/vhosts/blog/nuldoc-src/pages/post.ts @@ -13,6 +13,9 @@ export interface PostPage extends Page { description: string; tags: string[]; revisions: Revision[]; + published: Date; + updated: Date; + uuid: string; } export function getPostCreatedDate(page: { revisions: Revision[] }): Date { @@ -136,5 +139,8 @@ export async function generatePostPage( description: doc.description, tags: doc.tags, revisions: doc.revisions, + published: getPostCreatedDate(doc), + updated: getPostUpdatedDate(doc), + uuid: doc.uuid, }; } diff --git a/vhosts/blog/nuldoc-src/pages/slide.ts b/vhosts/blog/nuldoc-src/pages/slide.ts index b84aeb38..5e4d1834 100644 --- a/vhosts/blog/nuldoc-src/pages/slide.ts +++ b/vhosts/blog/nuldoc-src/pages/slide.ts @@ -6,17 +6,21 @@ import { staticScriptElement } from "../components/utils.ts"; import { Config, getTagLabel } from "../config.ts"; import { el, text } from "../dom.ts"; import { Page } from "../page.ts"; -import { dateToString, Revision } from "../revision.ts"; +import { Date, dateToString, Revision } from "../revision.ts"; import { Slide } from "../slide/slide.ts"; -import { getPostCreatedDate } from "./post.ts"; +import { getPostCreatedDate, getPostUpdatedDate } from "./post.ts"; export interface SlidePage extends Page { title: string; + description: string; event: string; talkType: string; slideLink: string; tags: string[]; revisions: Revision[]; + published: Date; + updated: Date; + uuid: string; } export async function generateSlidePage( @@ -131,10 +135,14 @@ export async function generateSlidePage( destFilePath: destFilePath, href: destFilePath.replace("index.html", ""), title: slide.title, + description: `登壇: ${slide.event} (${slide.talkType})`, event: slide.event, talkType: slide.talkType, slideLink: slide.slideLink, tags: slide.tags, revisions: slide.revisions, + published: getPostCreatedDate(slide), + updated: getPostUpdatedDate(slide), + uuid: slide.uuid, }; } -- cgit v1.2.3-70-g09d2