nailivic

command module
v0.0.0-...-2a4c342 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 13 Imported by: 0

README

nailivic

Go + htmx rewrite of nailivic

frontend

htmx drives the frontend, utilizing HTML as the engine of application state.

Air

Live reload for Go apps, to see your changes in realtime without having to restart your server

Via go install

go install github.com/air-verse/air@latest

Then add an alias to your .bashrc (or whatever you have) so you can run the air server with fewer keystrokes:

alias air='~/usr/go/bin/air'

Github for air.

templates

Templates are handled by go's standard template/html package.

ordering templates

Templates may be comprised of other templates, but template import order matters.

[!IMPORTANT] Always import parent elements first, then any children parsed after.

This will work, because index defines subtemplates first, then the subtemplates are loaded.

tmpl, err := template.ParseFS(content,
    "static/html/index.html",
    "static/html/head.html",
    "static/html/footer.html",
)

This will not work. 😿

tmpl, err := template.ParseFS(content,
    "static/html/head.html",
    "static/html/footer.html",
    "static/html/index.html",
)

This will only work if the files are alphabetized. 🙃

tmpl, err := template.ParseFS(content,
    "static/html/*.html",
)

backend

Backend is a bog standard go server, utilizing a filesystem embedded in the binary for ease and speed.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL