]> git.openstreetmap.org Git - nominatim-ui.git/blob - build.sh
Merge pull request #16 from mtmail/bootstrap-tabs
[nominatim-ui.git] / build.sh
1 #!/bin/bash
2
3 mkdir -p dist/assets/
4 rsync --quiet --recursive src/assets/css/ dist/assets/css/
5 rsync --quiet --recursive src/assets/images/ dist/assets/images/
6
7 mkdir -p dist/assets/js/
8 cat src/assets/js/base.js src/assets/js/detailpage.js src/assets/js/searchpage.js src/assets/js/deletable.js src/assets/js/polygons.js > dist/assets/js/nominatim-ui.js
9
10 rsync --quiet node_modules/jquery/dist/jquery.min.js dist/assets/js/
11 rsync --quiet node_modules/leaflet/dist/leaflet.js dist/assets/js/
12 rsync --quiet node_modules/leaflet/dist/leaflet.js.map dist/assets/js/
13 rsync --quiet node_modules/leaflet/dist/leaflet.css dist/assets/css/
14 rsync --quiet node_modules/leaflet/dist/images/* dist/assets/css/images/
15
16 rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.js dist/assets/js/
17 rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.css dist/assets/css/
18 rsync --quiet node_modules/leaflet-minimap/dist/images/* dist/assets/css/images/
19
20 rsync --quiet node_modules/bootstrap/dist/js/bootstrap.bundle.min.js* dist/assets/js/
21 rsync --quiet node_modules/bootstrap/dist/css/bootstrap.min.css dist/assets/css/
22
23 rsync --quiet node_modules/handlebars/dist/handlebars.min.js dist/assets/js/
24 rsync --quiet node_modules/@ungap/url-search-params/min.js dist/assets/js/url-search-params.js
25 rsync --quiet src/templates/*.hbs dist/
26
27 rsync --quiet src/*.js dist/
28
29
30 {
31   sed -e 's/BODYID/search-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
32   echo '<script id="searchpage-template" type="text/x-handlebars-template">'
33   cat src/templates/searchpage.hbs
34   echo '</script>'
35   echo '</body>'
36   echo '</html>'
37 } > dist/search.html
38
39 {
40   sed -e 's/BODYID/reverse-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
41   echo '<script id="reversepage-template" type="text/x-handlebars-template">'
42   cat src/templates/reversepage.hbs
43   echo '</script>'
44   echo '</body>'
45   echo '</html>'
46 } > dist/reverse.html
47
48 {
49   sed -e 's/BODYID/details-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
50   echo '<script id="detailspage-template" type="text/x-handlebars-template">'
51   cat src/templates/detailspage.hbs
52   echo '</script>'
53   echo '<script id="detailspage-index-template" type="text/x-handlebars-template">'
54   cat src/templates/detailspage-index.hbs
55   echo '</script>'
56   echo '</body>'
57   echo '</html>'
58 } > dist/details.html
59
60 {
61   sed -e 's/BODYID/deletable-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
62   echo '<script id="deletable-template" type="text/x-handlebars-template">'
63   cat src/templates/deletable.hbs
64   echo '</script>'
65   echo '</body>'
66   echo '</html>'
67 } > dist/deletable.html
68
69 {
70   sed -e 's/BODYID/polygons-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
71   echo '<script id="polygons-template" type="text/x-handlebars-template">'
72   cat src/templates/polygons.hbs
73   echo '</script>'
74   echo '</body>'
75   echo '</html>'
76 } > dist/polygons.html
77
78 cp src/index.html dist/