cgsdev0 / bash-stack

modern web framework in bash
https://bashsta.cc
MIT License
399 stars 7 forks source link

Make it js framework independent #11

Open the-man-with-a-golden-mind opened 1 month ago

the-man-with-a-golden-mind commented 1 month ago

I've figure out that for each project, I am making a small changes in the core.sh I am changing the htmx_page() so I could have all of the js and css definitions in config.sh ` function htmx_page() { [[ ${HTTP_HEADERS["hx-request"]} == "true" ]] || [[ "$INTERNAL_REQUEST" == "true" ]] || cat <<-EOF <!doctype html>

${STYLES[*]} ${SCRIPTS[*]} $(_inject_hmr) EOF ` and also I am adding ` function page() { [[ "$INTERNAL_REQUEST" == "true" ]] || cat <<-EOF ${STYLES[*]} ${SCRIPTS[*]} EOF cat cat <<-EOF EOF } ` for more htmx independence. IMHO it looks clearer. What do you think about change the generator and add the htmx as the possibility not something mandatory? :)
cgsdev0 commented 1 month ago

not sure i follow the exact suggestion, but i do like the idea of a more generalized page function (and making the htmx_page function an opt-in thing)

dont have time to do this myself right now, but if you want to put up a PR happy to take a look