From 22a439fc6dbe7e37db01938df2822a763ee25925 Mon Sep 17 00:00:00 2001 From: vitusventure Date: Thu, 20 Sep 2018 21:00:20 +0000 Subject: [PATCH] Fix deployment scripts, minify base.js --- .gitignore | 2 ++ 5thsrd_theme/js/base.js | 42 +---------------------------------------- 5thsrd_theme/main.html | 2 +- build_to_test.sh | 4 ++-- deploy_to_prod.sh | 6 +++--- 5 files changed, 9 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 0d275494e..d0f8e8bd5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ docs/spellcasting/spell_lists docs/spellcasting/spell_indexes docs/gamemaster_rules/magic_item_indexes docs/gamemaster_rules/monster_indexes +__pycache__ +*.pyc diff --git a/5thsrd_theme/js/base.js b/5thsrd_theme/js/base.js index bd25cd4d1..c94968edc 100644 --- a/5thsrd_theme/js/base.js +++ b/5thsrd_theme/js/base.js @@ -1,41 +1 @@ -function getSearchTerm() -{ - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) - { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == 'q') - { - return sParameterName[1]; - } - } -} - -$(document).ready(function() { - - var search_term = getSearchTerm(), - $search_modal = $('#mkdocs_search_modal'); - - if(search_term){ - $search_modal.modal(); - } - - // make sure search input gets autofocus everytime modal opens. - $search_modal.on('shown.bs.modal', function () { - $search_modal.find('#mkdocs-search-query').focus(); - }); - -}); - - -$('table').addClass("table table-striped table-hover"); - -$('body').scrollspy({ - target: '.bs-sidebar', -}); - -/* Prevent disabled links from causing a page reload */ -$("li.disabled a").click(function() { - event.preventDefault(); -}); +function getSearchTerm(){for(var e=window.location.search.substring(1).split("&"),a=0;a - {% set version_id = "3a9a40" %} + {% set version_id = "8fcaaf" %} diff --git a/build_to_test.sh b/build_to_test.sh index 164be17ce..f898319a4 100755 --- a/build_to_test.sh +++ b/build_to_test.sh @@ -2,8 +2,8 @@ git pull -python build_indexes.py +python3 build_indexes.py mkdocs build --clean -aws s3 sync ./site/ s3://5thsrd.org-test/ --region="us-east-1" +aws s3 sync ./site/ s3://5thsrd.org-test/ --region="us-east-1" --delete diff --git a/deploy_to_prod.sh b/deploy_to_prod.sh index 46d445b4a..3adb6b7f6 100755 --- a/deploy_to_prod.sh +++ b/deploy_to_prod.sh @@ -4,13 +4,13 @@ git pull # Generate offline indexes -python build_indexes.py --offline +python3 build_indexes.py --offline # Build the offline site mkdocs build --clean --config-file offline_build_config.yml # Generate regular indexes -python build_indexes.py +python3 build_indexes.py # Build the site mkdocs build --clean @@ -21,7 +21,7 @@ zip -r /tmp/5thsrd_offline.zip 5thsrd_offline/ mv /tmp/5thsrd_offline.zip ./site/ # Sync to S3 -aws s3 sync ./site/ s3://5thsrd.org/ --region="us-east-1" +aws s3 sync ./site/ s3://5thsrd.org/ --region="us-east-1" --delete # Set Cache-Control on static resources s3cmd modify --recursive s3://5thsrd.org/css/ --add-header=Cache-Control:max-age=604800 -v