fronttool

package
v0.0.0-...-0d1d0b3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Tools collection to minify and prepare assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSS

func CSS(fsys fs.FS, m map[string]string) []byte

Merge and minify all **.css files from fsys. The paths are sorted before the merge.

Replace all `(_[\w\d]+)` with value of map m.

It panics on error.

func FileSum

func FileSum(data []byte) (shortHash string, integrity string)

FileSum hashs with sha256 the data.

  • shortHash return is the hex of the hash.
  • integrity is the integrity use as html attribute.

func InlineJs

func InlineJs(chuncks ...[]byte) render.H

Create a inline JS from multiple files. Use strict JS and wrap all in a closure with document as argument. It panic if an minify error occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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