]> git.openstreetmap.org Git - nominatim-ui.git/blobdiff - build.sh
Nominatim github organization name changed. Add github link for this frontend as...
[nominatim-ui.git] / build.sh
index 229bb6d262e0f98a6ba2dbf7fcdb328c5b1d0701..f77b8a3ae4c5f825213ebf7e0499b175bb394d8e 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -18,8 +18,8 @@ rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.css dist/ass
 rsync --quiet node_modules/leaflet-minimap/dist/images/* dist/assets/css/images/
 
 rsync --quiet node_modules/bootstrap/dist/js/bootstrap.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-theme.min.css dist/assets/css/
+rsync --quiet node_modules/bootstrap/dist/css/bootstrap.min.css* dist/assets/css/
+rsync --quiet node_modules/bootstrap/dist/css/bootstrap-theme.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
@@ -28,9 +28,31 @@ rsync --quiet src/templates/*.hbs dist/
 rsync --quiet src/*.js dist/
 
 
-cat src/layout.html | perl -pe'use File::Slurper qw(read_text); s/\@include\((.+?)\)/read_text($1)/eg' > /tmp/included.html
+# replaced the Perl one-liner with shell logic to remove the dependency
+# cat src/layout.html | perl -pe'use File::Slurper qw(read_text); s/\@include\((.+?)\)/read_text($1)/eg' > /tmp/included.html
+
+cat src/layout.html | grep -v '</body>' | grep -v '</html>' | sed -e 's/BODYID/search-page/' > dist/search.html
+echo '<script id="searchpage-template" type="text/x-handlebars-template">' >> dist/search.html
+cat src/templates/searchpage.hbs >> dist/search.html
+echo '</script>' >> dist/search.html
+echo '</body>' >> dist/search.html
+echo '</html>' >> dist/search.html
+
+cat src/layout.html | grep -v '</body>' | grep -v '</html>' | sed -e 's/BODYID/reverse-page/' > dist/reverse.html
+echo '<script id="reversepage-template" type="text/x-handlebars-template">' >> dist/reverse.html
+cat src/templates/reversepage.hbs >> dist/reverse.html
+echo '</script>' >> dist/reverse.html
+echo '</body>' >> dist/reverse.html
+echo '</html>' >> dist/reverse.html
+
+cat src/layout.html | grep -v '</body>' | grep -v '</html>' | sed -e 's/BODYID/details-page/' > dist/details.html
+echo '<script id="detailspage-template" type="text/x-handlebars-template">' >> dist/details.html
+cat src/templates/detailspage.hbs >> dist/details.html
+echo '</script>' >> dist/details.html
+echo '<script id="detailspage-index-template" type="text/x-handlebars-template">' >> dist/details.html
+cat src/templates/detailspage-index.hbs >> dist/details.html
+echo '</script>' >> dist/details.html
+echo '</body>' >> dist/details.html
+echo '</html>' >> dist/details.html
 
-cat /tmp/included.html | perl -pe's/BODYID/search-page/g' > dist/search.html
-cat /tmp/included.html | perl -pe's/BODYID/reverse-page/g' > dist/reverse.html
-cat /tmp/included.html | perl -pe's/BODYID/details-page/g' > dist/details.html
 cp src/index.html dist/