Skip to content

Commit

Permalink
Fix mkdocs search hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
borsboom committed Sep 4, 2017
1 parent 32dd4c4 commit 3b24964
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions etc/mkdocsjs/searchhack.js → doc/js/searchhack.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
observer.disconnect();
var form = $('#rtd-search-form');
form.empty();
form.attr('action', 'https://' + window.location.hostname + '/en/' + determineSelectedBranch() + '/search.html');
form.attr('action', 'https://' + window.location.hostname + '/' + window.location.pathname.split('/')[1] + '/' + window.location.pathname.split('/')[2] + '/search.html');
$('<input>').attr({
type: "text",
name: "q",
placeholder: "Search docs"
}).appendTo(form);
});

if (window.location.origin.indexOf('readthedocs') > -1) {
if (window.location.origin.indexOf('readthedocs') > -1 || window.location.origin.indexOf('docs.haskellstack') > -1) {
observer.observe(target, config);
}
}
Expand Down
5 changes: 2 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ site_dir: _site
theme: readthedocs
extra_css:
- css/extra.css
extra_javascript:
- js/searchhack.js

pages:
- Home: README.md
Expand Down Expand Up @@ -38,6 +40,3 @@ pages:
markdown_extensions:
- toc:
permalink: true

extra_javascript:
- etc/mkdocsjs/searchhack.js

0 comments on commit 3b24964

Please sign in to comment.