Skip to content

Commit

Permalink
Merge pull request #3909 from werf/site-improve-search
Browse files Browse the repository at this point in the history
site: Tune google search, highlight documentation version, remove guide's banner
  • Loading branch information
alexey-igrychev committed Nov 16, 2021
2 parents 76b87d1 + 7ad0750 commit 65536bb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/site/_includes/group-menu.html
Expand Up @@ -18,4 +18,4 @@
</ul>
</div>
</li>
{% endraw %}
{% endraw %}
18 changes: 18 additions & 0 deletions docs/site/js/customscripts.js
Expand Up @@ -140,6 +140,16 @@ $(document).ready(function () {
$('.topsearch').removeClass('topsearch_active');
}
});

let CurrentGroup = getDocGroupFromURL();
$('input[name="sitesearch"]').attr("value",function(index,currentvalue){
if (CurrentGroup) {
return currentvalue + "/documentation/" + CurrentGroup + "/"
} else {
return currentvalue
}
})

});

$(document).ready(function() {
Expand Down Expand Up @@ -455,6 +465,14 @@ $(document).ready(function () {
}
});

function getDocGroupFromURL() {
let result = window.location.pathname.match(/^\/documentation\/(v\d+\.\d+)/);
if ( result && result[1] ) {
return result[1];
}
return null;
}

function getDocVersionFromURL() {
let result = window.location.pathname.match(/\/documentation\/(v\d+\.\d+([^/]+)?)\/.*/);
if ( result ) {
Expand Down
1 change: 0 additions & 1 deletion docs/site/pages_en/guides.md
Expand Up @@ -2,7 +2,6 @@
title: Guides
permalink: /guides.html
layout: plain
banner: guides
breadcrumbs: none
---

Expand Down
1 change: 0 additions & 1 deletion docs/site/pages_ru/guides.md
Expand Up @@ -2,7 +2,6 @@
title: Руководства
permalink: /guides.html
layout: plain
banner: guides
breadcrumbs: none
---

Expand Down

0 comments on commit 65536bb

Please sign in to comment.