Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!1v2.0
Showing
with 478 additions and 99 deletions
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.
File added
File added
......@@ -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;
}
......
File added
File added
$(function() {
$('[data-toggle="tooltip"]').tooltip();
});
File added
File added
This diff is collapsed.
File added
File added
File moved
File added
File added
This diff is collapsed.
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment