Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[documentation] Add a nice search experience to the website #416

Merged
merged 5 commits into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions themes/jquery/css/docsearch.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Custom DocSeach CSS to adapt the generic one * See https://community.algolia.com/docsearch/styling.html for more info */
nav#main .searchform {
text-shadow: none;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file still uses spaces, please change to tabs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. fixed

}

.searchform label {
width: 100%;
display: block;
}

.algolia-autocomplete {
width: 99%;
}

@media only screen and (max-width: 480px) {
.ds-dropdown-menu {
min-width: 100% !important;
}
}
7 changes: 6 additions & 1 deletion themes/jquery/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
</footer>

<?php wp_footer(); ?>

<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" onload="docsearch({apiKey: '3cfde9aca378c8aab554d5bf1b23489b',
indexName: 'jquery',
inputSelector: 'input[name=\'s\']',
debug: true // Set debug to true if you want to inspect the dropdown
})" async></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use tabs for indentation in this file, can you update it? Also, what's inside of the object should be indented more than the closing parens.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Done

</body>
</html>
3 changes: 3 additions & 0 deletions themes/jquery/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

<script src="https://use.typekit.net/wde1aof.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/docsearch.css">

<?php
if ( is_singular() && get_option( 'thread_comments' ) )
Expand Down