From 6e70fe447ec9504757fbdc152b5b3697c9af8def Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 7 Oct 2026 03:14:47 +0300 Subject: Initial iteration --- website.templ | 147 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 77 insertions(+), 70 deletions(-) (limited to 'website.templ') diff --git a/website.templ b/website.templ index a3f137a..face9f9 100644 --- a/website.templ +++ b/website.templ @@ -1,81 +1,88 @@ package main -import "fmt" +templ HeadComponent(title string, description string) { + + + + + + + + + + + { title } + + + + + + + + + + { children... } + +} + +templ NavLink(href string, label string) { + { label } +} -// 1. Shared Base Layout Component -templ PageLayout(title string) { - - - - - { title } - - - - - -
- { children... } - - +templ NavComponent(path string) { + } -// 2. Page 1: Home -templ HomePage() { - @PageLayout("Home") { -

Home

-

Go server running with Templ templates and Air hot-reloading.

- } +templ TerminalLayout(style Style, path string) { + + + @HeadComponent(path, "My personal website") { + + } + +
+ @NavComponent(path) + { children... } +
+ + } -// 3. Page 2: About -templ AboutPage() { - @PageLayout("About") { -

About

-

Single-binary web app using Go's standard library net/http.

- } +templ HomePage(style Style) { + @TerminalLayout(style, "/home/kyren/") { + + } } -// Data struct for dynamic rendering -type Item struct { - Name string - Active bool +templ SkillsPage(style Style) { + @TerminalLayout(style, "/home/kyren/skills.md") { +

About

+

Single-binary web app using Go's standard library net/http.

+ } } -// 4. Page 3: Dynamic Data (Conditionals + Loops) -templ ItemsPage(items []Item) { - @PageLayout("Items") { -

Items

-
- if len(items) == 0 { -

No items in database.

- } else { - - } -
-

- { fmt.Sprintf("Total items processed: %d", len(items)) } -

- } +templ ProjectsPage(style Style, projects []Project) { + @TerminalLayout(style, "/home/kyren/projects") { +

Items

+
+ +
+ } +} -- cgit v1.3.1