Commit 80f0df2e authored by ale's avatar ale
Browse files

Serve pre-compressed static resources

Fix also some errors in the status template, and update to Bootstrap
4.3.1 and JQuery 3.4.0.
parent 050f2525
SOURCES = \
static/css/style.css \
static/css/bootstrap.min.css \
static/js/bootstrap.bundle.min.js \
static/js/jquery-3.4.0.slim.min.js \
static/js/autoradio.js
COMPRESSED = \
$(SOURCES:%=%.br) \
$(SOURCES:%=%.gz)
%.br: %
brotli --input $^ --output $@
%.gz: %
zopfli $^
all: $(COMPRESSED)
clean:
-rm -f $(COMPRESSED)
This diff is collapsed.
package node
//go:generate make
//go:generate go-bindata --nocompress --pkg node static/... templates/...
import (
......@@ -21,6 +22,7 @@ import (
"git.autistici.org/ale/autoradio"
pb "git.autistici.org/ale/autoradio/proto"
assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/lpar/gzipped"
)
var (
......@@ -34,7 +36,7 @@ func newHTTPHandler(n *Node, icecastPort int, domain string) http.Handler {
tpl := mustParseEmbeddedTemplates()
// Serve /static/ from builtin assets.
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(&assetfs.AssetFS{
mux.Handle("/static/", http.StripPrefix("/static/", gzipped.FileServer(&assetfs.AssetFS{
Asset: Asset,
AssetDir: AssetDir,
AssetInfo: AssetInfo,
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ body {
}
.page-header {
background: url(radio52.png) top left no-repeat;
background: url(../radio52.png) top left no-repeat;
padding-left: 58px;
}
......
$(function() {
$('[data-toggle="tooltip"]').tooltip();
});
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment