From 3fe4b2fda55ff1a9e69f194ddbc9449d69bc3b11 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 5 Dec 2017 14:11:21 +0100 Subject: [PATCH] backport documentation variable configurations (#3850) * Correct custom search IDs, sitemap and edit URLs * deploy versions through shell script from central places * shellcheckify * shellcheck, indent * move all configs into one file * add settings * one more char that may occur in ids * add per book version, its not yet the right ids. * Update VERSIONS Created new CSE for Devel Cookbook, replaced all IDs by Devel CSE IDs, adjusted prio to 0.3 --- Documentation/Books/AQL/book.json | 4 +- Documentation/Books/AQL/styles/header.js | 27 +- Documentation/Books/Cookbook/book.json | 8 +- Documentation/Books/Cookbook/styles/header.js | 25 +- Documentation/Books/HTTP/book.json | 4 +- Documentation/Books/HTTP/styles/header.js | 24 +- Documentation/Books/Manual/book.json | 4 +- Documentation/Books/Manual/styles/header.js | 24 +- Documentation/Books/build.sh | 580 +++++++++--------- VERSIONS | 7 + 10 files changed, 395 insertions(+), 312 deletions(-) create mode 100644 VERSIONS diff --git a/Documentation/Books/AQL/book.json b/Documentation/Books/AQL/book.json index b964a8abc3..31cb54110f 100644 --- a/Documentation/Books/AQL/book.json +++ b/Documentation/Books/AQL/book.json @@ -37,8 +37,8 @@ }, "sitemap-general": { "prefix": "https://docs.arangodb.com/devel/AQL/", - "changefreq": "daily", - "priority": 0.3 + "changefreq": "@GCHANGE_FREQ@", + "priority": @GPRIORITY@ }, "ga": { "token": "UA-81053435-2" diff --git a/Documentation/Books/AQL/styles/header.js b/Documentation/Books/AQL/styles/header.js index 121989a137..eeca362577 100644 --- a/Documentation/Books/AQL/styles/header.js +++ b/Documentation/Books/AQL/styles/header.js @@ -1,4 +1,7 @@ // Try to set the version number early, jQuery not available yet +var searcheable_versions = [@BROWSEABLE_VERSIONS@]; +var cx = '@GSEARCH_ID@'; + document.addEventListener("DOMContentLoaded", function(event) { if (!gitbook.state.root) return; var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//); @@ -16,7 +19,22 @@ window.localStorage.removeItem(":keyword"); $(document).ready(function() { function appendHeader() { - + var VERSION_SELECTOR = "" + var i = 0; + var prefix; + for (i = 0; i < searcheable_versions.length; i++ ) { + if (searcheable_versions[i] === 'devel') { + prefix = ''; + } else { + prefix = 'v'; + } + VERSION_SELECTOR += '\n'; + } + var div = document.createElement('div'); div.innerHTML = '
\n' + ' \n' + ' \n' + '