template-go-website Tailwind Templates

Template Go Website

Starter template for go website with htmx and tailwind

Template layout for simple go webserver/website

Prerequisite

Air
Templ
NodeJs
Make

Running

[!WARNING]
make docker-run in the root makefile does not work for now.

Install npm dependencies (tailwind) and start watching the css file:

cd ./web
npm install
make tw-watch

In the project root directory run the following command to start the website server

cd src
make dev

You might have to run templ generate before running the make dev command, every time you make a change to a .templ file. If you use neovim you can use this autocommand to run templ generate after every buffer write.

vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
    desc = 'running templ generate on save',
    group = <your-group>,
    pattern = { '*.templ' },
    callback = function()
        vim.cmd(":silent !templ generate")
    end
})

Top categories

Loading Svelte Themes