diff --git a/templates.go b/templates.go index 224c48e47c4ae020b90560310bb6a01f9d88385a..e8b8b3a12605f00a6ac32be4939ca46426bb898c 100644 --- a/templates.go +++ b/templates.go @@ -94,17 +94,6 @@ return true } "time" -package main - var num int - for _, a := range articles { - if !a.Draft { - num++ - } - } - return num -} - - "time" "time" opts = []chromahtml.Option{ chromahtml.WithClasses(true), diff --git a/templates.templ b/templates.templ index 00a0b9bdb66eba2b0398e66c8b2149c410204659..7d1bbcfdd525bbf3bacc5465bfeb82682ad0e9ff 100644 --- a/templates.templ +++ b/templates.templ @@ -30,21 +30,19 @@

Just a guy living in the middle of nowhere who likes to hack on open-source.

for category, articles := range articles { - if Published(articles) > 0 { -

{ category }

- }
} @@ -61,10 +59,9 @@

{ article.Category }

{ article.Date.Format("Mon, 02 Jan 2006") }

-
- @templ.Raw(article.Content) -templ baseTemplate(title, description string) { + } } + diff --git a/templates_templ.go b/templates_templ.go index fb1535bdc024f4144c7e637edb5aa8912727aa36..efd8eb839501066937bba77a1bf4f629742ce229 100644 --- a/templates_templ.go +++ b/templates_templ.go @@ -1,6 +1,6 @@ // Code generated by templ - DO NOT EDIT. -// templ: version: v0.2.608 +// templ: version: 0.2.480 package main //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -29,12 +29,8 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) +// Code generated by templ - DO NOT EDIT. -package main - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates.templ`, Line: 11, Col: 17} - } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -43,15 +38,9 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") -import "github.com/a-h/templ" //lint:file-ignore SA4006 This context is only used if a nested component is present. +import "io" - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") - return templ_7745c5c3_Err + if templ_7745c5c3_Err != nil { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) import "github.com/a-h/templ" -//lint:file-ignore SA4006 This context is only used if a nested component is present. } } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") @@ -215,8 +211,8 @@ _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) } return templ_7745c5c3_Err }) -import "bytes" // Code generated by templ - DO NOT EDIT. + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -246,17 +242,22 @@ if !templ_7745c5c3_IsBuffer { templ_7745c5c3_Buffer = templ.GetBuffer() defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

jolheiser


") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 string + templ_7745c5c3_Var12 := `jolheiser` - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(article.Title) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates.templ`, Line: 53, Col: 22} + return templ_7745c5c3_Err } // Code generated by templ - DO NOT EDIT. -// Code generated by templ - DO NOT EDIT. + } + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var13 string = article.Title + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -265,14 +266,10 @@ if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } // Code generated by templ - DO NOT EDIT. -// templ: version: v0.2.608 - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(article.Category) if templ_7745c5c3_Err != nil { // Code generated by templ - DO NOT EDIT. -//lint:file-ignore SA4006 This context is only used if a nested component is present. - } // Code generated by templ - DO NOT EDIT. -import "github.com/a-h/templ" +// Code generated by templ - DO NOT EDIT. if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -281,13 +278,9 @@ if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } // Code generated by templ - DO NOT EDIT. -import "io" + return templ_7745c5c3_Err // Code generated by templ - DO NOT EDIT. +import "github.com/a-h/templ" -import "bytes" - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates.templ`, Line: 56, Col: 71} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -304,15 +297,25 @@ if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } // Code generated by templ - DO NOT EDIT. -// Code generated by templ - DO NOT EDIT. + if Published(articles) > 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var16))) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">") + if templ_7745c5c3_Err != nil { //lint:file-ignore SA4006 This context is only used if a nested component is present. +import "bytes" + } // Code generated by templ - DO NOT EDIT. + return templ_7745c5c3_Err defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) +//lint:file-ignore SA4006 This context is only used if a nested component is present. if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } // Code generated by templ - DO NOT EDIT. - } + var templ_7745c5c3_Var7 string if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }