diff --git a/flake.lock b/flake.lock index e5a883e..aade7c1 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,82 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1694102001, + "narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705314449, + "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1705718568, @@ -33,33 +109,13 @@ "type": "github" } }, - "nur": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1700580516, - "narHash": "sha256-h72i6afGKreU+DjpZ6+qersarYYp4YjX+DBQ+MQkOG4=", - "ref": "refs/heads/main", - "rev": "a68a81cbc743e84aaee331ae7e58699398dd732d", - "revCount": 167, - "type": "git", - "url": "https://git.jojodev.com/jolheiser/nur" - }, - "original": { - "type": "git", - "url": "https://git.jojodev.com/jolheiser/nur" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "nur": "nur", "tailwind-ctp": "tailwind-ctp", - "tailwind-ctp-lsp": "tailwind-ctp-lsp" + "tailwind-ctp-lsp": "tailwind-ctp-lsp", + "templ": "templ" } }, "systems": { @@ -77,6 +133,21 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tailwind-ctp": { "inputs": { "nixpkgs": [ @@ -116,6 +187,51 @@ "type": "git", "url": "https://git.jojodev.com/jolheiser/tailwind-ctp-intellisense" } + }, + "templ": { + "inputs": { + "gitignore": "gitignore", + "gomod2nix": "gomod2nix", + "nixpkgs": [ + "nixpkgs" + ], + "xc": "xc" + }, + "locked": { + "lastModified": 1709917943, + "narHash": "sha256-zDQxUFSmG/VX+xtK+nZ3ObRMVcMjjx+EUAxHLNcHHF8=", + "owner": "a-h", + "repo": "templ", + "rev": "df2a32403bb4a8e4745ac10ddc8b3e77386d8045", + "type": "github" + }, + "original": { + "owner": "a-h", + "repo": "templ", + "type": "github" + } + }, + "xc": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "templ", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703164129, + "narHash": "sha256-kCcCqqwvjN07H8FPG4tXsRVRcMqT8dUNt9pwW1kKAe8=", + "owner": "joerdav", + "repo": "xc", + "rev": "0655cccfcf036556aeaddfb8f45dc7e8dd1b3680", + "type": "github" + }, + "original": { + "owner": "joerdav", + "repo": "xc", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2f1afb8..1d8cd45 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; - nur = { - url = "git+https://git.jojodev.com/jolheiser/nur"; + templ = { + url = "github:a-h/templ"; inputs.nixpkgs.follows = "nixpkgs"; }; tailwind-ctp = { @@ -20,23 +20,23 @@ self, flake-utils, nixpkgs, - nur, + templ, tailwind-ctp, tailwind-ctp-lsp, } @ inputs: flake-utils.lib.eachDefaultSystem ( system: let pkgs = nixpkgs.legacyPackages.${system}; - nur = inputs.nur.packages.${system}; tailwind-ctp = inputs.tailwind-ctp.packages.${system}.default; tailwind-ctp-lsp = inputs.tailwind-ctp-lsp.packages.${system}.default; + templ = inputs.templ.packages.${system}.templ; in { packages.default = pkgs.buildGoModule { pname = "jolheiser.com"; version = "site"; src = ./.; - vendorHash = "sha256-i/A6k0xaIPuWCfK6pm7TczkRaIWXzAjOGTXLIeDbxRw="; - nativeBuildInputs = [nur.templ tailwind-ctp]; + vendorHash = nixpkgs.lib.fileContents ./go.mod.sri; + nativeBuildInputs = [templ tailwind-ctp]; excludedPackages = "."; postBuild = '' go generate @@ -46,7 +46,7 @@ devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ go - nur.templ + templ tailwind-ctp tailwind-ctp-lsp vscode-langservers-extracted diff --git a/go.mod b/go.mod index 885c769..2e79f8a 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module jolheiser.com -go 1.20 +go 1.21 require ( git.jojodev.com/jolheiser/simpleicons v0.0.3 - github.com/a-h/templ v0.2.334 + github.com/a-h/templ v0.2.598 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.mod.sri b/go.mod.sri new file mode 100644 index 0000000..0439228 --- /dev/null +++ b/go.mod.sri @@ -0,0 +1 @@ +sha256-SYSzOO6M83uojEalPUe58FqkGYhUQASum9cZs7Kcng4= \ No newline at end of file diff --git a/go.sum b/go.sum index dcf20c4..82d9b07 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,9 @@ git.jojodev.com/jolheiser/simpleicons v0.0.3 h1:R/UEcl6L6wAScHKu/oYyB0jY62inYes56aM91YlTfqE= git.jojodev.com/jolheiser/simpleicons v0.0.3/go.mod h1:NIhFsYI7rALmUX37teVRzf8BJAv1XtZC1OGeVjmB/No= -github.com/a-h/templ v0.2.334 h1:/mKupkgHGeSSeC0KiGRvmUoRGQJuku9VGVhRP1CeWgY= -github.com/a-h/templ v0.2.334/go.mod h1:6Lfhsl3Z4/vXl7jjEjkJRCqoWDGjDnuKgzjYMDSddas= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/a-h/templ v0.2.598 h1:6jMIHv6wQZvdPxTuv87erW4RqN/FPU0wk7ZHN5wVuuo= +github.com/a-h/templ v0.2.598/go.mod h1:SA7mtYwVEajbIXFRh3vKdYm/4FYyLQAtPH1+KxzGPA8= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/jolheiser.com b/jolheiser.com new file mode 100755 index 0000000..36320df Binary files /dev/null and b/jolheiser.com differ diff --git a/site_templ.go b/site_templ.go index d93daa2..70fe836 100644 --- a/site_templ.go +++ b/site_templ.go @@ -1,5 +1,6 @@ -// Code generated by templ@(devel) DO NOT EDIT. +// Code generated by templ - DO NOT EDIT. +// templ: version: v0.2.608 package main //lint:file-ignore SA4006 This context is only used if a nested component is present. @@ -10,35 +11,26 @@ import "io" import "bytes" func head() templ.Component { - return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) { - templBuffer, templIsBuffer := w.(*bytes.Buffer) - if !templIsBuffer { - templBuffer = templ.GetBuffer() - defer templ.ReleaseBuffer(templBuffer) + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - var_1 := templ.GetChildren(ctx) - if var_1 == nil { - var_1 = templ.NopComponent + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, err = templBuffer.WriteString("") - if err != nil { - return err + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<head><title>jolheiser") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - var_2 := `jolheiser` - _, err = templBuffer.WriteString(var_2) - if err != nil { - return err + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) } - _, err = templBuffer.WriteString("") - if err != nil { - return err - } - if !templIsBuffer { - _, err = templBuffer.WriteTo(w) - } - return err + return templ_7745c5c3_Err }) } @@ -47,128 +39,150 @@ func fill(hex string) string { } func body(links []Link) templ.Component { - return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) { - templBuffer, templIsBuffer := w.(*bytes.Buffer) - if !templIsBuffer { - templBuffer = templ.GetBuffer() - defer templ.ReleaseBuffer(templBuffer) + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - var_3 := templ.GetChildren(ctx) - if var_3 == nil { - var_3 = templ.NopComponent + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, err = templBuffer.WriteString("
\"avatar\"

") - if err != nil { - return err + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

\"avatar\"

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - var var_4 string = `@` - _, err = templBuffer.WriteString(templ.EscapeString(var_4)) - if err != nil { - return err + var templ_7745c5c3_Var3 string + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(`@`) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `site.templ`, Line: 22, Col: 58} } - var_5 := `jolheiser` - _, err = templBuffer.WriteString(var_5) - if err != nil { - return err + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - _, err = templBuffer.WriteString("

") - if err != nil { - return err + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - if !templIsBuffer { - _, err = templBuffer.WriteTo(w) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) } - return err + return templ_7745c5c3_Err }) } func index(links []Link) templ.Component { - return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) { - templBuffer, templIsBuffer := w.(*bytes.Buffer) - if !templIsBuffer { - templBuffer = templ.GetBuffer() - defer templ.ReleaseBuffer(templBuffer) + return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) { + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) } ctx = templ.InitializeContext(ctx) - var_9 := templ.GetChildren(ctx) - if var_9 == nil { - var_9 = templ.NopComponent + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - err = head().Render(ctx, templBuffer) - if err != nil { - return err + templ_7745c5c3_Err = head().Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - err = body(links).Render(ctx, templBuffer) - if err != nil { - return err + templ_7745c5c3_Err = body(links).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err } - if !templIsBuffer { - _, err = templBuffer.WriteTo(w) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) } - return err + return templ_7745c5c3_Err }) }