summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-21 15:56:09 +0000
committerHimanshu Sardana <himanshusardana2005@gmail.com>2026-03-21 15:56:09 +0000
commite96d14697caf388763d36893a8f63f8beacd34cf (patch)
treeff88ea80497f97e9e9480ee9ef49b6199dd95b6a /main.go
parentf5938f34c146e8df8cb71a532d99e7007e0b7471 (diff)
feat: generate list of post titles
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 9 insertions, 0 deletions
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) {