GothBase is a Go templating system optimized for Linux development, using Air and a Makefile, along with the Goth and Gotth stack.
- you can see the structure of the template at example
Ensure you have Golang and Linux. WSL may work if it supports curl, go commands, and chmod.
Makefile and Air work with Bash commands.
- clone the project with the next command:
git clone https://github.com/santedev/gothBaseOr run next command to install templ:
go install github.com/a-h/templ/cmd/templ@latest- Build the CLI:
cd cligo build -o ../GothBase../GothBaseOr run next command:
cd cligo run .Note: The output directory will be one level up from the cli cloned folder.
Command Line Navigation when input is required
- Next Step: Key
Enter. - Previous Step: Key
ctrl+u. - Confirm Creation: Key
Enter.
Command Line Navigation
- Move Up/Down: Use arrow keys or
kandj. - Next Step: Arrow
rightorn. - Previous Step: Arrow
leftorb. - Select Options:
EnterorSpace. - Confirm Creation: Press
yto confirm ornto cancel.
with templ installed run next command
templ generateif errors encountered try
~/go/bin/templ generateIn the public/scripts directory, you'll find files like htmx.min.js, jquery.min.js, and alpine.js, depending on the options you selected during setup. For example, if you only need HTMX, you can opt for that by selecting all options except JavaScript and then choosing HTMX.
With the default setup, which includes JavaScript minified files, you're equipped to use jQuery's ecosystem if needed or leverage Alpine UI libraries with Tailwind UI. Explore Pines JS, Penguin UI, and Alpine UI Components for more.
To add your own JavaScript scripts, place them in the public/scripts folder for consistency. Then, include them in views/layout/ if you want to add the script to the base layout, either within the HTML <head> or <body> tags using the Templ component.
Similarly, the public directory is intended for your CSS files. You can create a css folder and add your stylesheets there, following a similar process as with JavaScript.
Here's how you can update the manual installation instructions for Windows, specifically for PowerShell: Manual Installation for Windows (PowerShell)
- Install TailwindCSS:
Invoke-WebRequest -Uri "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-win-x64.zip" -OutFile "tailwindcss.zip"
Expand-Archive -Path "tailwindcss.zip" -DestinationPath "."
Remove-Item -Path "tailwindcss.zip"- Install JS Min Files:
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/htmx.org/dist/htmx.min.js" -OutFile "public/scripts/htmx.min.js"
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/alpinejs/dist/cdn.min.js" -OutFile "public/scripts/alpine.js"
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js" -OutFile "public/scripts/jquery.min.js"
