From e96d14697caf388763d36893a8f63f8beacd34cf Mon Sep 17 00:00:00 2001 From: Himanshu Sardana Date: Sat, 21 Mar 2026 15:56:09 +0000 Subject: feat: generate list of post titles --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 05d10ba..ccdf74a 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,9 @@ type Page struct { TOC []TOCItem } +type Post struct { + Title string +} type Frontmatter struct { Title string `yaml:"title"` } @@ -39,6 +42,8 @@ func main() { contentDir := "./content" outputDir := "./output" + posts := make([]Post, 0) + themeName := "modern-light" args := os.Args @@ -72,6 +77,8 @@ func main() { fmt.Println("Processing:", path) title, htmlContent, toc := convertToHtml(path) + posts = append(posts, Post{Title: title}) + // fmt.Println("Appended post", posts) newPage := Page{ Title: title, Content: template.HTML(htmlContent), @@ -115,6 +122,8 @@ func main() { } fmt.Println("All files processed!") + + fmt.Println(posts) } func convertToHtml(path string) (string, []byte, []TOCItem) { -- cgit v1.3.1