-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy: complete refactor to use tailwindcss and templ
- Loading branch information
1 parent
da67937
commit 2f2553c
Showing
87 changed files
with
1,171 additions
and
1,676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
/* | ||
* | ||
|
||
!README.md | ||
!LICENSE | ||
|
||
# go webserver code | ||
!cmd/ | ||
# go | ||
!internal/ | ||
!.air.toml | ||
!go.mod | ||
!go.sum | ||
!gomod2nix.toml | ||
cmd/webserver/public/js/ | ||
|
||
# blogs | ||
!posts/ | ||
|
||
# odin wasm code | ||
!client/ | ||
# uploader | ||
!cmd/uploader | ||
|
||
# nix code | ||
!nix/ | ||
!nix/* | ||
!flake.* | ||
|
||
# docker | ||
Makefile | ||
!Makefile | ||
|
||
# services | ||
!services/**/default.nix | ||
!services/**/*.go | ||
!services/**/*.templ | ||
services/**/*_templ.go | ||
|
||
# webserver | ||
!.air.toml | ||
!services/webserver/public/** | ||
services/webserver/**/*.js | ||
!services/webserver/public/tailwind.config.js | ||
!posts/ | ||
|
||
!*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Ethan Thoma | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,65 @@ | ||
IMAGE_NAME = webserver | ||
TAG = 0.1 | ||
PORT = 8080 | ||
SYSTEM = x86_64-linux | ||
|
||
run: build | ||
docker load < result | ||
docker run --rm --env-file ./.env -p 127.0.0.1:8080:8080 -t $(IMAGE_NAME):$(TAG) | ||
run: | ||
nix run github:Mic92/nix-fast-build -- --flake '.#packages.$(SYSTEM).default' | ||
nix run | ||
|
||
build: | ||
docker/build: | ||
nix build .#container | ||
|
||
docker: docker/build | ||
docker load < result | ||
docker run \ | ||
--rm \ | ||
--env-file ./.env \ | ||
-p 127.0.0.1:$(PORT):$(PORT) \ | ||
-t $(IMAGE_NAME):$(TAG) | ||
|
||
live/templ: | ||
templ generate \ | ||
--watch \ | ||
--proxy="http://localhost:3001" \ | ||
--open-browser=false \ | ||
-v \ | ||
--path=./services/webserver/ | ||
|
||
live/server: | ||
air \ | ||
--build.cmd "go build -o tmp/bin/main personal-website/services/webserver" \ | ||
--build.bin "tmp/bin/main" \ | ||
--build.delay "100" \ | ||
--build.include_dir "personal-website/services/webserver" \ | ||
--build.include_ext "go" \ | ||
--build.stop_on_error "false" \ | ||
--misc.clean_on_exit true \ | ||
--proxy.enabled true \ | ||
--proxy.proxy_port 3001 \ | ||
--proxy.app_port $(PORT) | ||
|
||
live/tailwind: | ||
tailwindcss \ | ||
-c ./services/webserver/public/tailwind.config.js \ | ||
-i ./services/webserver/public/main.css \ | ||
-o ./public/main.css \ | ||
-m \ | ||
-w | ||
|
||
live/sync_assets: | ||
rsync -a ./services/webserver/public/* ./public --exclude='*.css' | ||
sleep 0.1 | ||
air \ | ||
--build.cmd "templ generate --notify-proxy" \ | ||
--build.bin "true" \ | ||
--build.delay "100" \ | ||
--build.exclude_dir "" \ | ||
--build.include_dir "public" \ | ||
--build.include_ext "js,css" | ||
|
||
live: | ||
make live/templ & \ | ||
make live/server & \ | ||
make live/tailwind & \ | ||
make live/sync_assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.