-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move js/ into assets/js/ and make assets/ as static file server #221
Conversation
it's better to made it own framework I think hahahaha |
@@ -2,5 +2,5 @@ package web | |||
|
|||
import "embed" | |||
|
|||
//go:embed "js" | |||
//go:embed "assets" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this needs to be assets/*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@H0llyW00dzZ, it sounds great!, but for now the reason is to help user who wants to add a simple custom css or add some images with just putting their folder into assets/
and load it in their templ. ❤️
@EssaAlshammri, I've test it with generating all the go-blueprint supported frameworks + htmx and the htmx is still loads and works. For your suggestion, I think I need to test it more further. Thx for reviewing my code btw. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this needs to be assets/*
I've added more test stuff in file server like css file and img file with go:embed "assets"
directive, it looks fine. Then I reread the embed pkg documentation, interestingly I found:
If a pattern names a directory, all files in the subtree rooted at that directory are embedded (recursively), except that files with names beginning with ‘.’ or ‘_’ are excluded.
Should I update to assets/*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@H0llyW00dzZ, it sounds great!, but for now the reason is to help user who wants to add a simple custom css or add some images with just putting their folder into
assets/
and load it in their templ. ❤️@EssaAlshammri, I've test it with generating all the go-blueprint supported frameworks + htmx and the htmx is still loads and works. For your suggestion, I think I need to test it more further. Thx for reviewing my code btw. 👍
@kobamkode
How can you design the CSS for htmx? I am so bad at designing websites, to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should have been a css folder with a default css file to be easier to add styles to the web app Or better add tailwind with the advance flag |
I agree with the suggestion for Tailwind, as mentioned in #186,#224. Because Go + HTMX is better, and the only missing component is CSS, unlike other languages, especially Java, which consumes a lot of memory. Also I don't understand why most developers write Java when it's better to write Go, especially for microservices. |
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
Move
js/
intoassets/js
and makeassets/
as a static file server, so user can easily add a custom folder likecmd/web/assets/css/
and link it intobase.templ
if they want it.Description of Changes:
cmd/program/program.go
to create assets/cmd/template/advanced/files/htmx/base.templ.tmpl
go:embed "js"
togo:embed "assets"
cmd/template/advanced/files/htmx/routes
Checklist