]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - build.sh
detailsURL helper which replaces detailsLink and detailsPermaLink
[nominatim-ui.git] / build.sh
index 9ecf435cdcf5bca5d43c9505a64d954b7c18d0c1..973ccbd0576975c31656578bc36113718bdde763 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,78 +1,69 @@
 #!/bin/bash
 
 mkdir -p dist/assets/
-rsync --quiet --recursive src/assets/css/ dist/assets/css/
+rsync --quiet --recursive src/assets/css/    dist/assets/css/
 rsync --quiet --recursive src/assets/images/ dist/assets/images/
 
 mkdir -p dist/assets/js/
-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
+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   \
+    src/assets/js/controller.js > dist/assets/js/nominatim-ui.js
 
-rsync --quiet node_modules/jquery/dist/jquery.min.js dist/assets/js/
-rsync --quiet node_modules/leaflet/dist/leaflet.js dist/assets/js/
+rsync --quiet node_modules/jquery/dist/jquery.min.js   dist/assets/js/
+rsync --quiet node_modules/leaflet/dist/leaflet.js     dist/assets/js/
 rsync --quiet node_modules/leaflet/dist/leaflet.js.map dist/assets/js/
-rsync --quiet node_modules/leaflet/dist/leaflet.css dist/assets/css/
-rsync --quiet node_modules/leaflet/dist/images/* dist/assets/css/images/
+rsync --quiet node_modules/leaflet/dist/leaflet.css    dist/assets/css/
+rsync --quiet node_modules/leaflet/dist/images/*       dist/assets/css/images/
 
-rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.js dist/assets/js/
+rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.js  dist/assets/js/
 rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.css dist/assets/css/
-rsync --quiet node_modules/leaflet-minimap/dist/images/* dist/assets/css/images/
+rsync --quiet node_modules/leaflet-minimap/dist/images/*                dist/assets/css/images/
 
 rsync --quiet node_modules/bootstrap/dist/js/bootstrap.bundle.min.js* dist/assets/js/
-rsync --quiet node_modules/bootstrap/dist/css/bootstrap.min.css dist/assets/css/
+rsync --quiet node_modules/bootstrap/dist/css/bootstrap.min.css       dist/assets/css/
 
 rsync --quiet node_modules/handlebars/dist/handlebars.min.js dist/assets/js/
-rsync --quiet node_modules/@ungap/url-search-params/min.js dist/assets/js/url-search-params.js
-rsync --quiet src/templates/*.hbs dist/
+rsync --quiet node_modules/@ungap/url-search-params/min.js   dist/assets/js/url-search-params.js
 
 rsync --quiet src/*.js dist/
 
 
 {
-  sed -e 's/BODYID/search-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
+  cat src/layout.html | grep -v '</body>' | grep -v '</html>'
   echo '<script id="searchpage-template" type="text/x-handlebars-template">'
   cat src/templates/searchpage.hbs
   echo '</script>'
-  echo '</body>'
-  echo '</html>'
-} > dist/search.html
 
-{
-  sed -e 's/BODYID/reverse-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
   echo '<script id="reversepage-template" type="text/x-handlebars-template">'
   cat src/templates/reversepage.hbs
   echo '</script>'
-  echo '</body>'
-  echo '</html>'
-} > dist/reverse.html
 
-{
-  sed -e 's/BODYID/details-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
   echo '<script id="detailspage-template" type="text/x-handlebars-template">'
   cat src/templates/detailspage.hbs
   echo '</script>'
+
   echo '<script id="detailspage-index-template" type="text/x-handlebars-template">'
   cat src/templates/detailspage-index.hbs
   echo '</script>'
-  echo '</body>'
-  echo '</html>'
-} > dist/details.html
 
-{
-  sed -e 's/BODYID/deletable-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
   echo '<script id="deletable-template" type="text/x-handlebars-template">'
   cat src/templates/deletable.hbs
   echo '</script>'
-  echo '</body>'
-  echo '</html>'
-} > dist/deletable.html
 
-{
-  sed -e 's/BODYID/polygons-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
   echo '<script id="polygons-template" type="text/x-handlebars-template">'
   cat src/templates/polygons.hbs
   echo '</script>'
+
   echo '</body>'
   echo '</html>'
-} > dist/polygons.html
+} > dist/search.html
+
+cp dist/search.html dist/reverse.html
+cp dist/search.html dist/details.html
+cp dist/search.html dist/deletable.html
+cp dist/search.html dist/polygons.html
 
 cp src/index.html dist/