aboutsummaryrefslogtreecommitdiffhomepage
path: root/nuldoc-src/components/slide_page_entry.ts
diff options
context:
space:
mode:
Diffstat (limited to 'nuldoc-src/components/slide_page_entry.ts')
-rw-r--r--nuldoc-src/components/slide_page_entry.ts44
1 files changed, 44 insertions, 0 deletions
diff --git a/nuldoc-src/components/slide_page_entry.ts b/nuldoc-src/components/slide_page_entry.ts
new file mode 100644
index 0000000..3aff5ae
--- /dev/null
+++ b/nuldoc-src/components/slide_page_entry.ts
@@ -0,0 +1,44 @@
+import { el, Element, text } from "../dom.ts";
+import { getPostCreatedDate, getPostUpdatedDate } from "../pages/post.ts";
+import { SlidePage } from "../pages/slide.ts";
+
+export function slidePageEntry(slide: SlidePage): Element {
+ return el(
+ "article",
+ [["class", "post-entry"]],
+ el(
+ "a",
+ [["href", slide.href]],
+ el(
+ "header",
+ [["class", "entry-header"]],
+ el("h2", [], text(`登壇: ${slide.event} (${slide.talkType})`)),
+ ),
+ el(
+ "section",
+ [["class", "entry-content"]],
+ el("p", [], text(slide.title)),
+ ),
+ el(
+ "footer",
+ [["class", "entry-footer"]],
+ el(
+ "time",
+ [["datetime", getPostCreatedDate(slide)]],
+ text(getPostCreatedDate(slide)),
+ ),
+ text(" 登壇"),
+ ...(slide.revisions.length > 1
+ ? [
+ text("、"),
+ el("time", [[
+ "datetime",
+ getPostUpdatedDate(slide),
+ ]], text(getPostUpdatedDate(slide))),
+ text(" 更新"),
+ ]
+ : []),
+ ),
+ ),
+ );
+}