diff --git a/flake.lock b/flake.lock index f5bcb522d6f69dcc5e62033951b6297b31a4d3aa..daaaf1e6cd10f38cd6cdfcffc70cec73f2b1677c 100644 --- a/flake.lock +++ b/flake.lock @@ -41,12 +41,12 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1709087332, + "lastModified": 1694102001, - "nodes": { "locked": { + }, "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6", "type": "github" }, "original": { @@ -64,11 +64,11 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1722589758, + "lastModified": 1705314449, - "narHash": "sha256-sbbA8b6Q2vB/t/r1znHawoXLysCyD4L/6n6/RykiSnA=", + "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "4e08ca09253ef996bd4c03afa383b23e35fe28a1", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", "type": "github" }, "original": { @@ -79,11 +79,11 @@ } }, "nixpkgs": { "locked": { - "lastModified": 1728679842, + "lastModified": 1710106936, - "narHash": "sha256-c8LQCDsH4h5MRoeq3grbDhvk5FLEsv8xXFY/pFcFLrE=", + "narHash": "sha256-VBjP7qVARzQ+TJDhQA7P9Da8QVm9ChHf/p3U16LtMjU=", "owner": "nixos", "repo": "nixpkgs", - "inputs": { + "lastModified": 1694529238, "flake-utils": { "type": "github" }, @@ -124,14 +124,14 @@ ], "xc": "xc" }, "locked": { - "systems": "systems" "lastModified": 1694529238, + "inputs": { + "lastModified": 1694529238, "systems": "systems" - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "a-h", "repo": "templ", + "lastModified": 1694529238, }, - "nodes": { "type": "github" }, "original": { @@ -149,11 +149,11 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1724404748, + "lastModified": 1703164129, - "narHash": "sha256-p6rXzNiDm2uBvO1MLzC5pJp/0zRNzj/snBzZI0ce62s=", + "narHash": "sha256-kCcCqqwvjN07H8FPG4tXsRVRcMqT8dUNt9pwW1kKAe8=", "owner": "joerdav", "repo": "xc", - }, + "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "type": "github" }, diff --git a/flake.nix b/flake.nix index a1035961990ef9c3456531756fbb44e2041919d0..cef6a9fdfccae38fbceb771767c5dde25f92bd3d 100644 --- a/flake.nix +++ b/flake.nix @@ -7,62 +7,59 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = -{ + templ = { { -{ + templ = { inputs = { -{ + templ = { nixpkgs.url = "github:nixos/nixpkgs"; -{ + templ = { templ = { -{ + templ = { url = "github:a-h/templ"; -{ + templ = { inputs.nixpkgs.follows = "nixpkgs"; -{ + templ = { }; -{ + templ = { }; -{ + templ = { - inputs = { + url = "github:a-h/templ"; - { - inputs = { + url = "github:a-h/templ"; { - inputs = { + url = "github:a-h/templ"; inputs = { - inputs = { + url = "github:a-h/templ"; nixpkgs.url = "github:nixos/nixpkgs"; - inputs = { + url = "github:a-h/templ"; templ = { - inputs = { + url = "github:a-h/templ"; url = "github:a-h/templ"; - inputs = { + url = "github:a-h/templ"; inputs.nixpkgs.follows = "nixpkgs"; - inputs = { + url = "github:a-h/templ"; }; - inputs = { + url = "github:a-h/templ"; }; - inputs = { + url = "github:a-h/templ"; - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; { - nixpkgs.url = "github:nixos/nixpkgs"; + }; + inputs.nixpkgs.follows = "nixpkgs"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs"; - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; templ = { - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; url = "github:a-h/templ"; - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs"; - nixpkgs.url = "github:nixos/nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; }; - vscode-langservers-extracted + }; - ]; - }; - }; + }; } diff --git a/go.mod b/go.mod index e83daac31f4290202ee032f1f498df6067f1bfaf..7ceafc376a1ad3103fb558460bda9de589c7ba7a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.6 require ( github.com/BurntSushi/toml v1.3.2 - github.com/a-h/templ v0.2.778 + github.com/a-h/templ v0.2.543 github.com/alecthomas/chroma/v2 v2.12.0 github.com/gorilla/feeds v1.1.2 github.com/yuin/goldmark v1.7.0 diff --git a/go.mod.sri b/go.mod.sri index 7787f01765df1420a0e1db54ada9b7c5842e76af..8d173c1399888091ee2009049373bbc9d824186e 100644 --- a/go.mod.sri +++ b/go.mod.sri @@ -1 +1 @@ -sha256-AdXfH+hHYm0KXW9eXquZnWt49EimmMjpbUYOMEvamX8= \ No newline at end of file +sha256-kBUyYzHuCrNgD/KMXqrsd1V1xqpQmBADURIOh9CUFso= \ No newline at end of file diff --git a/go.sum b/go.sum index 5623fc73ffd61df27ee192120e5fa9d9d3d8ec3e..b6480dd6af6a990164073d9407775bc0744bff4a 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/a-h/templ v0.2.778 h1:VzhOuvWECrwOec4790lcLlZpP4Iptt5Q4K9aFxQmtaM= +github.com/a-h/templ v0.2.543 h1:8YyLvyUtf0/IE2nIwZ62Z/m2o2NqwhnMynzOL78Lzbk= -github.com/a-h/templ v0.2.778/go.mod h1:lq48JXoUvuQrU0VThrK31yFwdRjTCnIE5bcPCM9IP1w= +github.com/a-h/templ v0.2.543/go.mod h1:jP908DQCwI08IrnTalhzSEH9WJqG/Q94+EODQcJGFUA= github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink= github.com/alecthomas/assert/v2 v2.2.1/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/chroma/v2 v2.2.0/go.mod h1:vf4zrexSH54oEjJ7EdB65tGNHmH3pGZmVkgTP5RHvAs= diff --git a/templates_templ.go b/templates_templ.go index 265e3907885666585761805e55ee48fd6d4297af..3e781cce77b0a845b8054ebf0c0fed2cdae9aa72 100644 --- a/templates_templ.go +++ b/templates_templ.go @@ -1,34 +1,32 @@ // Code generated by templ - DO NOT EDIT. +// Code generated by templ - DO NOT EDIT. // templ: version: v0.2.786 + package main //lint:file-ignore SA4006 This context is only used if a nested component is present. import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" +import "context" +import "io" +import "bytes" import "fmt" func baseTemplate(title, description string) templ.Component { // Code generated by templ - DO NOT EDIT. - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { -// Code generated by templ - DO NOT EDIT. // templ: version: v0.2.786 +import "github.com/a-h/templ" // Code generated by templ - DO NOT EDIT. -package main - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) if !templ_7745c5c3_IsBuffer { // Code generated by templ - DO NOT EDIT. -import templruntime "github.com/a-h/templ/runtime" -// Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 import "fmt" // Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 func baseTemplate(title, description string) templ.Component { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() } ctx = templ.InitializeContext(ctx) templ_7745c5c3_Var1 := templ.GetChildren(ctx) @@ -87,27 +85,25 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } return templ_7745c5c3_Err }) } func IndexTemplate(articles Articles) templ.Component { // Code generated by templ - DO NOT EDIT. - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + var templ_7745c5c3_Var3 string return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) +import templruntime "github.com/a-h/templ/runtime" if !templ_7745c5c3_IsBuffer { // Code generated by templ - DO NOT EDIT. -import templruntime "github.com/a-h/templ/runtime" -// Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 import "fmt" // Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 func baseTemplate(title, description string) templ.Component { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() } ctx = templ.InitializeContext(ctx) templ_7745c5c3_Var5 := templ.GetChildren(ctx) @@ -115,21 +111,15 @@ if templ_7745c5c3_Var5 == nil { templ_7745c5c3_Var5 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var6 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) -import "github.com/a-h/templ" // Code generated by templ - DO NOT EDIT. - templ_7745c5c3_Err = templ_7745c5c3_BufErr -import "github.com/a-h/templ" +package main // templ: version: v0.2.786 -import "github.com/a-h/templ" + } package main } - ctx = templ.InitializeContext(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

jolheiser

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

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -193,33 +183,34 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } return templ_7745c5c3_Err }) templ_7745c5c3_Err = baseTemplate("jolheiser's blog", "Hahaha yes.....YES!").Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } return templ_7745c5c3_Err }) } func ArticleTemplate(article Article) templ.Component { // Code generated by templ - DO NOT EDIT. - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + var templ_7745c5c3_Var3 string return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) +import templruntime "github.com/a-h/templ/runtime" if !templ_7745c5c3_IsBuffer { // Code generated by templ - DO NOT EDIT. -import templruntime "github.com/a-h/templ/runtime" -// Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 import "fmt" // Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.786 func baseTemplate(title, description string) templ.Component { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() } ctx = templ.InitializeContext(ctx) templ_7745c5c3_Var10 := templ.GetChildren(ctx) @@ -228,22 +219,16 @@ templ_7745c5c3_Var10 = templ.NopComponent } ctx = templ.ClearChildren(ctx) // Code generated by templ - DO NOT EDIT. -// templ: version: v0.2.786 -//lint:file-ignore SA4006 This context is only used if a nested component is present. +package main import "github.com/a-h/templ" - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) -import "github.com/a-h/templ" // Code generated by templ - DO NOT EDIT. - templ_7745c5c3_Err = templ_7745c5c3_BufErr -import "github.com/a-h/templ" +package main // templ: version: v0.2.786 -import "github.com/a-h/templ" + } package main } - ctx = templ.InitializeContext(ctx) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

jolheiser


") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -317,14 +302,18 @@ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">source") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer) + } return templ_7745c5c3_Err }) templ_7745c5c3_Err = baseTemplate(article.Title, article.Summary).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } return templ_7745c5c3_Err }) } - -var _ = templruntime.GeneratedTemplate