From 84519249928010e18f1f4bf05aaa4297a18fca8c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 23 Sep 2023 19:34:24 +0200 Subject: Make template names clearer --- src/templates.ts | 4 +-- templates/homepage.html | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ templates/index.html | 91 ------------------------------------------------- templates/list.html | 49 ++++++++++++++++++++++++++ templates/tag.html | 49 -------------------------- 5 files changed, 142 insertions(+), 142 deletions(-) create mode 100644 templates/homepage.html delete mode 100644 templates/index.html create mode 100644 templates/list.html delete mode 100644 templates/tag.html diff --git a/src/templates.ts b/src/templates.ts index 1006e21..a9fd857 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -48,7 +48,7 @@ async function render404Page(): Promise { async function renderHomepage(posts: Array): Promise { const file = matter(await Bun.file("content/_index.md").text()); const $ = await layout( - cheerio.load(await Bun.file("templates/index.html").text()), + cheerio.load(await Bun.file("templates/homepage.html").text()), config.title, ); @@ -101,7 +101,7 @@ async function renderPost(file: Post, content: string) { async function renderListPage(tag: string, posts: Post[]) { const $ = await layout( - cheerio.load(await Bun.file("templates/tag.html").text()), + cheerio.load(await Bun.file("templates/list.html").text()), tag || config.title, ); const $feed = $(".h-feed"); diff --git a/templates/homepage.html b/templates/homepage.html new file mode 100644 index 0000000..1138e04 --- /dev/null +++ b/templates/homepage.html @@ -0,0 +1,91 @@ + + + + + + Site Title + + + + + + +
+

+ Site title +

+ +
+
+
+
+

Latest Posts

+ +
+
+

Elsewhere on the Internet

+ +
+
+ + + diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 1138e04..0000000 --- a/templates/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Site Title - - - - - - -
-

- Site title -

- -
-
-
-
-

Latest Posts

- -
-
-

Elsewhere on the Internet

- -
-
- - - diff --git a/templates/list.html b/templates/list.html new file mode 100644 index 0000000..ae5b8e9 --- /dev/null +++ b/templates/list.html @@ -0,0 +1,49 @@ + + + + + + Site Title + + + + + + +
+

+ Site Title +

+ +
+
+ +
+ + + diff --git a/templates/tag.html b/templates/tag.html deleted file mode 100644 index ae5b8e9..0000000 --- a/templates/tag.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Site Title - - - - - - -
-

- Site Title -

- -
-
- -
- - - -- cgit 1.4.1