Skip to content

Commit

Permalink
Merge pull request prometheus#470 from prometheus/beorn7/slim-static-…
Browse files Browse the repository at this point in the history
…assets

Slim down the files we embed into the binary.
  • Loading branch information
beorn7 committed Jan 26, 2015
2 parents 50351b7 + 05ba9ab commit 855f20a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion console_libraries/prom.lib
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{/* Load Prometheus console library JS/CSS. Should go in <head> */}}
{{ define "prom_console_head" }}
<link type="text/css" rel="stylesheet" href="/static/vendor/rickshaw/rickshaw.min.css">
<link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.css">
<link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="/static/css/prom_console.css">
<script src="/static/vendor/rickshaw/vendor/d3.min.js"></script>
<script src="/static/vendor/rickshaw/vendor/d3.layout.min.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion utility/embed-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ do
cd "${dir}"
echo "\"$(basename ${dir})\": {"

find . -type f | while read file
# Do not embed map files and the non-minified bootstrap files.
find . -type f \! -name \*.map \! -name bootstrap.js \! -name bootstrap-theme.css \! -name bootstrap.css | while read file
do
name=$(echo "${file}"|sed 's|\.\/||')
echo "\"$name\": {"
Expand Down
8 changes: 3 additions & 5 deletions web/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

all: blob-stamp
all: blob

blob-stamp: templates/*
blob:
$(MAKE) -C blob
touch $@

clean:
$(MAKE) -C blob clean
-rm -f *-stamp

.PHONY: clean
.PHONY: clean blob
1 change: 1 addition & 0 deletions web/blob/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ all: files.go

SUFFIXES:

# Do not embed map files and the non-minified bootstrap files.
files.go: $(shell find ../templates/ ../static/ -type f)
../../utility/embed-static.sh ../static ../templates | $(GOFMT) > $@

Expand Down
2 changes: 1 addition & 1 deletion web/templates/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Prometheus Time Series Collection and Processing Server</title>
<script src="/static/vendor/js/jquery.min.js"></script>

<link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.css">
<link type="text/css" rel="stylesheet" href="/static/vendor/bootstrap-3.3.1/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="/static/css/prometheus.css">

{{template "head" .}}
Expand Down

0 comments on commit 855f20a

Please sign in to comment.