From 6ee35ced8650d65fbdbb5bbbe4575f53ae8fc801 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 29 May 2017 10:52:13 -0700 Subject: move scripts to separate include so we can include them across layouts even if the footer isn't there --- _includes/scripts.html | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 _includes/scripts.html (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html new file mode 100644 index 000000000..a713f81d0 --- /dev/null +++ b/_includes/scripts.html @@ -0,0 +1,50 @@ + + + + + +{% if site.github %} + +{% else %} + +{% endif %} + +{% if site.github %} + +{% else %} + + + + +{% endif %} + + + + + +{% if page.layout == "docs" %} + + +{% endif %} + + -- cgit v1.2.3 From 86177ac3afcaf79294596d025e400a657b495eed Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 29 May 2017 14:20:03 -0700 Subject: account for new nav structure --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index a713f81d0..b9a83876b 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -31,7 +31,7 @@ inputSelector: '#search-input', transformData: function (hits) { return hits.map(function (hit) { - hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', ''); + hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', 'http://localhost:9001/docs/4.0'); return hit; }); }, -- cgit v1.2.3 From c890d9a46b1483cf5857d8fd9d694ea6a06a9a2e Mon Sep 17 00:00:00 2001 From: Maxime Locqueville Date: Thu, 1 Jun 2017 08:11:06 +0200 Subject: Fix search redirect --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index b9a83876b..bc411c226 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -31,7 +31,7 @@ inputSelector: '#search-input', transformData: function (hits) { return hits.map(function (hit) { - hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', 'http://localhost:9001/docs/4.0'); + hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', '/docs/4.0'); return hit; }); }, -- cgit v1.2.3 From 6436233a9c786d32990a5fbc0c7dcc9e1af8332b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 8 Jul 2017 13:02:13 -0700 Subject: update docsearch config to handle h1s properly (load top of page, not at the h1) --- _includes/scripts.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index bc411c226..da73fdd68 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -29,6 +29,12 @@ apiKey: '48cb48b22351bc71ea5f12f4d1ede198', indexName: 'bootstrap-v4', inputSelector: '#search-input', + handleSelected: function (input, event, suggestion) { + var url = suggestion.url; + url = suggestion.isLvl1 ? url.split('#')[0]: url; + // If it's a title we remove the anchor so it does not jump. + window.location.href = url; + }, transformData: function (hits) { return hits.map(function (hit) { hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', '/docs/4.0'); -- cgit v1.2.3 From 77bd8fe91a4a576038ccc4e1b3965fbbc0fb9c84 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 11 Aug 2017 17:29:25 +0300 Subject: Remove `text/javascript` since it's the default one. (#23321) --- _includes/scripts.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index da73fdd68..f4cb6cd79 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -23,8 +23,8 @@ {% if page.layout == "docs" %} - - + {% endif %} - - {% if page.layout == "docs" %} -- cgit v1.2.3 From 20abbc3c16d39ad92fbf0b497a3690967764a1fd Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 16 Jul 2017 16:54:09 +0300 Subject: Register a service worker. --- _includes/scripts.html | 1 + 1 file changed, 1 insertion(+) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index 058ba1b33..fca699880 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -16,6 +16,7 @@ + {% endif %} -- cgit v1.2.3 From 1f4486c31b41208108e3d39df3e2dbcc47effa03 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 15 Aug 2017 14:41:34 +0300 Subject: Reduce liquid's whitespace for a few pages. Also fix a couple of typos while at it and change header tags' order. --- _includes/scripts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '_includes/scripts.html') diff --git a/_includes/scripts.html b/_includes/scripts.html index fca699880..f457828ad 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -51,5 +51,5 @@ Holder.addTheme('gray', { fg: 'rgba(255,255,255,.75)', font: 'Helvetica', fontweight: 'normal' -}) +}); -- cgit v1.2.3