diff --git a/cmd/program/program.go b/cmd/program/program.go index e32bf272e..a615b5aa9 100644 --- a/cmd/program/program.go +++ b/cmd/program/program.go @@ -505,6 +505,18 @@ func (p *Project) CreateMainFile() error { return err } + htmxTailwindConfigJsFile, err := os.Create(fmt.Sprintf("%s/tailwind.config.js", projectPath)) + if err != nil { + return err + } + defer htmxTailwindConfigJsFile.Close() + + htmxTailwindConfigJsTemplate := advanced.HtmxTailwindConfigJsTemplate() + err = os.WriteFile(fmt.Sprintf("%s/tailwind.config.js", projectPath), htmxTailwindConfigJsTemplate, 0o644) + if err != nil { + return err + } + efsFile, err := os.Create(fmt.Sprintf("%s/%s/efs.go", projectPath, cmdWebPath)) if err != nil { return err diff --git a/cmd/template/advanced/files/htmx/tailwind/tailwind.config.js.tmpl b/cmd/template/advanced/files/htmx/tailwind/tailwind.config.js.tmpl new file mode 100644 index 000000000..fc4468507 --- /dev/null +++ b/cmd/template/advanced/files/htmx/tailwind/tailwind.config.js.tmpl @@ -0,0 +1,5 @@ +module.exports = { + content: ["./**/*.html", "./**/*.templ", "./**/*.go",], + theme: { extend: {}, }, + plugins: [], +} diff --git a/cmd/template/advanced/routes.go b/cmd/template/advanced/routes.go index e7860f58f..a671b5e7f 100644 --- a/cmd/template/advanced/routes.go +++ b/cmd/template/advanced/routes.go @@ -28,6 +28,9 @@ var inputCssTemplate []byte //go:embed files/tailwind/output.css.tmpl var outputCssTemplate []byte +//go:embed files/htmx/tailwind/tailwind.config.js.tmpl +var htmxTailwindConfigJsTemplate []byte + //go:embed files/htmx/htmx.min.js.tmpl var htmxMinJsTemplate []byte @@ -140,6 +143,10 @@ func OutputCssTemplate() []byte { return outputCssTemplate } +func HtmxTailwindConfigJsTemplate() []byte { + return htmxTailwindConfigJsTemplate +} + func HtmxJSTemplate() []byte { return htmxMinJsTemplate }