From a2feb8c63c80a1f52830f562af2deb2c6065eaae Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 24 Jun 2024 21:48:36 +0200 Subject: move templ templates into separate package --- templates/homepage.templ | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 templates/homepage.templ (limited to 'templates/homepage.templ') diff --git a/templates/homepage.templ b/templates/homepage.templ new file mode 100644 index 0000000..0afbb2f --- /dev/null +++ b/templates/homepage.templ @@ -0,0 +1,42 @@ +package templates + +import ( + "website/internal/config" + "website/internal/content" +) + +templ Homepage(config config.Config, posts []content.Post, content string) { + @Page(config, PageSettings{ + Title: config.Title, + TitleAttrs: templ.Attributes{ + "class": "p-name u-url", + }, + Path: "/", + BodyAttrs: templ.Attributes{ + "class": "h-card", + }, + }) { +
+ @Unsafe(content) +
+
+

Latest Posts

+ @list(posts[0:3]) +
+
+

Elsewhere on the Internet

+ +
+ } +} -- cgit 1.4.1