diff --git a/.gitignore b/.gitignore index dff3f3e..c288811 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /functions + +# Local Netlify folder +.netlify diff --git a/build.sh b/build.sh index 966f539..8d0b06c 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,4 @@ cd ./src +go install github.com/a-h/templ/cmd/templ@latest +$GOPATH/bin/templ generate . GOBIN=$(pwd)/../functions go install . diff --git a/netlify.toml b/netlify.toml index bcc2cb1..af0d796 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,9 +1,13 @@ [build] - command = "go install github.com/a-h/templ/cmd/templ@latest && templ generate ./src && sh ./build.sh" + command = "sh ./build.sh" functions = "functions" - publish = "public" [build.environment] GO_IMPORT_PATH = "github.com/cassis163/personal-site" GO111MODULE = "on" GO_VERSION = "1.21.2" + +[[redirects]] + from = "/*" + to = "/.netlify/functions/gateway/:splat" + status = 200