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/gothBase
Or run next command to install templ:
go install github.com/a-h/templ/cmd/templ@latest
- Build the CLI:
cd cli
go build -o ../GothBase
../GothBase
Or run next command:
cd cli
go 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
k
andj
. - Next Step: Arrow
right
orn
. - Previous Step: Arrow
left
orb
. - Select Options:
Enter
orSpace
. - Confirm Creation: Press
y
to confirm orn
to cancel.
with templ installed run next command
templ generate
if errors encountered try
~/go/bin/templ generate
In 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"