From 900a707fdcb04e5739126ec2509fdc39fee7491c Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Sun, 7 Apr 2024 19:43:04 +0530 Subject: Rewrote Site in 11ty Still need to Update the content --- src/server/template/Post.ts | 48 --------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/server/template/Post.ts (limited to 'src/server/template/Post.ts') diff --git a/src/server/template/Post.ts b/src/server/template/Post.ts deleted file mode 100644 index c348f8b..0000000 --- a/src/server/template/Post.ts +++ /dev/null @@ -1,48 +0,0 @@ -import schema from "../utils/schema.js" -import metadata from "../metadata.js" -import Base, { content } from "./Base.js" -import h from "./header.js" -import slugify from "@sindresorhus/slugify" -import { c } from "./vdom.js" -import type { PageI } from "./Page.js" -import { article, small, time, span, a, p, div } from "./html.js" - -export var posts: ReturnType[] = [] - -interface PostI extends Omit { - title: string, - description: string, - date_pub: Date, - date_mod?: Date -} - -export default function Post(data: Type): ReturnType> { - var args = { - ...data, - content() { - var { date_mod, title, date_pub, description } = this - return c(article, { itemscope: true, itemtype: schema("BlogPosting") }, - c(h, { level: 1, itemprop: "headline" }, title), - c(small, {}, - ...(date_mod ? [ - c(time, { datetime: date_mod.toISOString(), itemprop: "dateModified" }, date_mod.toDateString()), - "- Modified " - ] : []), - c(time, { datetime: date_pub.toISOString(), itemprop: "datePublished" }, date_pub.toDateString()) - , " - ", - c(span, { itemprop: "author", itemscope: true, itemtype: schema("Person") }, - c(a, { href: metadata.author.url, rel: "author", itemprop: "url" }, - c(span, { itemprop: "name" }, metadata.author.name)) - ), - c(p, { itemprop: "abstract" }, description) - ), - c(div, { itemprop: "articleBody" }, c(content, { data })) - ) - }, - url: `/posts/${slugify(data.title)}` - } - const post = Base(args) - posts.push(post) - return post -} - -- cgit v1.2.3-70-g09d2