Skip to content

Commit

Permalink
focus search box on site start page
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Nov 17, 2020
1 parent bbbf289 commit 9e4aef5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/partials/footer-scripts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
{{#if env.ALGOLIA_API_KEY}}
<script async id="search-script" src="{{{uiRootPath}}}/js/vendor/docsearch.js"{{#if env.ALGOLIA_APP_ID}} data-app-id="{{env.ALGOLIA_APP_ID}}"{{/if}} data-api-key="{{env.ALGOLIA_API_KEY}}" data-index-name="{{env.ALGOLIA_IDX_NAME}}" data-stylesheet="{{{uiRootPath}}}/css/vendor/docsearch.css"></script>
{{#if page.home}}
<script>
window.addEventListener('load', function () { document.querySelector('#search-input').focus() })
</script>
{{/if}}
{{/if}}

0 comments on commit 9e4aef5

Please sign in to comment.