init: gnumake for live restarts on src \ tailwind
This commit is contained in:
parent
77cd5da548
commit
c19eb9104e
|
@ -0,0 +1,35 @@
|
||||||
|
##
|
||||||
|
# Project Title
|
||||||
|
# Some Automoderation
|
||||||
|
#
|
||||||
|
# @file
|
||||||
|
# @version 0.1
|
||||||
|
TEMPLATES = $(wildcard routes/templates/*.gohtml routes/templates/**/*.gohtml)
|
||||||
|
TAILWIND_OUT = routes/static/out.css
|
||||||
|
TAILWIND_IN = routes/in.css
|
||||||
|
TAILWIND_CONF = tailwind.config.js
|
||||||
|
|
||||||
|
# if we need to run just one time, with all dependencies built first
|
||||||
|
.PHONY: run
|
||||||
|
run: tailwindcss
|
||||||
|
go run .
|
||||||
|
|
||||||
|
# this uses wgo to re-execute 'make run'
|
||||||
|
# which will toggle tailwind out.css build only if necessery
|
||||||
|
# and then do `go run .` to rebuild all else
|
||||||
|
.PHONY: run/live
|
||||||
|
run/live:
|
||||||
|
wgo -verbose -file=.go -file=.gohtml -file=$(TAILWIND_CONF) make run
|
||||||
|
|
||||||
|
# this is alias to concrete task that will build out.css
|
||||||
|
.PHONY: tailwindcss
|
||||||
|
tailwindcss: $(TAILWIND_OUT)
|
||||||
|
|
||||||
|
# this is concrete task to build out.css file
|
||||||
|
# having as 'concrete' allows to not rebuild the output when inputs haven't changed
|
||||||
|
# then having .PHONY tailwindcss is easier to specify as dependency,
|
||||||
|
# but also i think phony tasks are "always" executed when depended upon
|
||||||
|
$(TAILWIND_OUT): $(TEMPLATES) $(TAILWIND_IN) $(TAILWIND_CONF)
|
||||||
|
tailwindcss -i $(TAILWIND_IN) -o $(TAILWIND_OUT)
|
||||||
|
|
||||||
|
# end
|
|
@ -12,9 +12,11 @@
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.go
|
pkgs.go
|
||||||
|
pkgs.wgo
|
||||||
pkgs.semgrep
|
pkgs.semgrep
|
||||||
pkgs.gopls
|
pkgs.gopls
|
||||||
pkgs.nodePackages.tailwindcss
|
pkgs.nodePackages.tailwindcss
|
||||||
|
pkgs.gnumake
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export GOPATH=$PWD/.go
|
export GOPATH=$PWD/.go
|
||||||
|
|
2
main.go
2
main.go
|
@ -13,7 +13,7 @@ func main() {
|
||||||
flag.IntVar(&port, "port", 8080, "Port on which the server should start")
|
flag.IntVar(&port, "port", 8080, "Port on which the server should start")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
fmt.Printf("Server will start on port %d", port)
|
fmt.Printf("Server will start on port %d\n", port)
|
||||||
|
|
||||||
routes.RegisterRoutes()
|
routes.RegisterRoutes()
|
||||||
|
|
||||||
|
|
|
@ -534,12 +534,12 @@ video {
|
||||||
--tw-backdrop-sepia: ;
|
--tw-backdrop-sepia: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-amber-600 {
|
|
||||||
--tw-bg-opacity: 1;
|
|
||||||
background-color: rgb(217 119 6 / var(--tw-bg-opacity));
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-amber-400 {
|
.bg-amber-400 {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(251 191 36 / var(--tw-bg-opacity));
|
background-color: rgb(251 191 36 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-xl {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
line-height: 1.75rem;
|
||||||
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
class="bg-amber-400"
|
class="bg-amber-400 text-xl"
|
||||||
>
|
>
|
||||||
<!--[if lt IE 8]>
|
<!--[if lt IE 8]>
|
||||||
<p class="browserupgrade">
|
<p class="browserupgrade">
|
||||||
|
|
Loading…
Reference in New Issue