- {post.excerpt}
+export const IndexTemplate = (posts: Post[]) => posts
+ .map((post) => (
+
+ {PostHeaderTemplate(post)}
+
+ {post.excerpt}
- {post.hasExcerpt && (
-
- Read More
-
- )}
-
+ {post.hasExcerpt && (
+
+ Read More
+
+ )}
- ))
- .join("");
-}
+
+ ))
+ .join("");
diff --git a/src/templates/page.tsx b/src/templates/page.tsx
index 39f09b28..fd257b6e 100644
--- a/src/templates/page.tsx
+++ b/src/templates/page.tsx
@@ -1,230 +1,214 @@
import { BASE_URL, html, Page } from "~/compiler/index.ts";
-export function PageTemplate(page: Page): string {
- return (
- "" +
- (
-
-
-
+export const PageTemplate = (page: Page) =>
+ "" +
+ (
+
+
+
+
+
+
);
-}
diff --git a/src/templates/post.tsx b/src/templates/post.tsx
index d173dacc..50b87c71 100644
--- a/src/templates/post.tsx
+++ b/src/templates/post.tsx
@@ -1,12 +1,10 @@
import { html, Post } from "~/compiler/index.ts";
import { PostHeaderTemplate } from "./postHeader.tsx";
-export function PostTemplate(post: Post): string {
- return (
-
- {PostHeaderTemplate(post)}
+export const PostTemplate = (post: Post) => (
+
+ {PostHeaderTemplate(post)}
-
{post.contents}
-
- );
-}
+
{post.contents}
+
+);
diff --git a/src/templates/postHeader.tsx b/src/templates/postHeader.tsx
index 61e1e6ba..563760aa 100644
--- a/src/templates/postHeader.tsx
+++ b/src/templates/postHeader.tsx
@@ -1,28 +1,24 @@
import { encode, formatDate, getTagUrl, html, Post } from "~/compiler/index.ts";
-export function PostHeaderTemplate(post: Post): string {
- return (
-