diff --git a/.gitignore b/.gitignore index 1031d0a..5d1350d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ passport .env passport.db -public/uploads/ \ No newline at end of file +public/uploads/ +zqdgr +assets/tailwind.css \ No newline at end of file diff --git a/README.md b/README.md index adce0f6..2db8f19 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Passport is a simple, fast, and lightweight web dashboard/new tab replacement. ### Prerequisites +- [ZQDGR](https://github.com/juls0730/zqdgr) - [Go](https://go.dev/doc/install) - [sqlite3](https://www.sqlite.org/download.html) - [TailwdinCSS CLI](https://github.com/tailwindlabs/tailwindcss/releases/latest) diff --git a/main.go b/main.go index 282318d..3e1dcb9 100644 --- a/main.go +++ b/main.go @@ -40,6 +40,28 @@ var viewsFS embed.FS //go:embed assets/** var assetsFS embed.FS +var devContent string = `` + type Category struct { ID int64 `json:"id"` Name string `json:"name"` @@ -483,6 +505,10 @@ func main() { return string(css) }) + engine.AddFunc("devContent", func() string { + return devContent + }) + router := fiber.New(fiber.Config{ Views: engine, }) diff --git a/prod.go b/prod.go new file mode 100644 index 0000000..cf1eec9 --- /dev/null +++ b/prod.go @@ -0,0 +1,8 @@ +//go:build prod +// +build prod + +package main + +func init() { + devContent = `` +} diff --git a/views/layouts/main.hbs b/views/layouts/main.hbs index 7d61d47..bc230ed 100644 --- a/views/layouts/main.hbs +++ b/views/layouts/main.hbs @@ -12,5 +12,5 @@ {{embed}} - +{{{devContent}}} \ No newline at end of file diff --git a/zqdgr.config.json b/zqdgr.config.json new file mode 100644 index 0000000..22849c2 --- /dev/null +++ b/zqdgr.config.json @@ -0,0 +1,17 @@ +{ + "name": "passport", + "version": "0.0.1", + "description": "Passport is a simple, lightweight, and fast dashboard/new tab page for your browser.", + "author": "juls0730", + "license": "BSL-1.0", + "homepage": "https://github.com/juls0730/passport", + "repository": { + "type": "git", + "url": "https://github.com/juls0730/passport.git" + }, + "scripts": { + "dev": "go generate; go run main.go", + "build": "go generate && go build -tags netgo,prod -o passport" + }, + "pattern": "**/*.go,views/**/*.hbs,styles/**/*.css,assets/**/*.{svg,png,jpg,jpeg,webp,woff2,ttf,otf,eot,ico,gif,webp}" +} \ No newline at end of file