go-htmx

command module
v0.0.0-...-d29b377 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

go-htmx

I created this repository to study about Golang with HTMX

https://www.youtube.com/watch?v=J3QXFClUSlc&list=PL8M9ZjrDX7lpqFj1NzRKoLgE1wGOMNRsi

tailwind docs https://tailwindcss.com/docs https://www.youtube.com/watch?v=ft30zcMlFao

1 - npm install jsqr --save

setup: npm install -D tailwindcss npx tailwindcss init

HTMX setup

npm init npm install -D prettier prettier-plugin-go-template touch prettier.config.cjs

const config = {
    plugins: ["prettier-plugin-go-template"],
    override: [
        {
            files: ["*.html"],
            option: {
                parser: "go-template"
            },
        },
    ],
};

module.exports = config

npm install -D vite npm install htmx.org

touch vite.config.js

import { resolve } from "path";
import { defineConfig } from "vite";

export default defineConfig({
    build: {
        lib: {
            entry: [resolve(__dirname, "src/htmx.js")],
            formats: ["es"],
            name: "[name]",
            fileName: "[name]"
        },
        outDir: "static",
        emptyOutDir: false
    },
});
  • add "type": "module", inside package.json
  • add "dev": "vite build --watch" in script section of package.json
  • write src/htmx.js file

npm run dev

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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