Upgrade swiftype to 2.0 library and added a results page for searches

This commit is contained in:
Alex Wolfe 2016-10-12 09:48:30 -07:00 committed by Naomi Black
parent cdfe957ab8
commit 5732b07423
12 changed files with 110 additions and 34 deletions

View File

@ -37,32 +37,4 @@ script(src="/resources/js/directives/code-example.js")
script(src="/resources/js/directives/if-docs.js") script(src="/resources/js/directives/if-docs.js")
script(src="/resources/js/directives/live-example.js") script(src="/resources/js/directives/live-example.js")
script(src="/resources/js/directives/ngio-ex-path.js") script(src="/resources/js/directives/ngio-ex-path.js")
script(src="/resources/js/directives/scroll-y-offset-element.js") script(src="/resources/js/directives/scroll-y-offset-element.js")
<!-- GA -->
script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-8594346-15', 'auto');
ga('send', 'pageview')
if current.path[0] == "docs"
<!-- SWIFTYPE -->
script.
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v1/st.js','_st');
_st('install','VsuU7kH5Hnnj9tfyNvfK');
<!-- Google Feedback -->
script(src="//www.gstatic.com/feedback/api.js" type="text/javascript")
<!-- Twitter Widget -->
script.
(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}})(document,"script","twitter-wjs");

View File

@ -0,0 +1,27 @@
<!-- GA -->
script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-8594346-15', 'auto');
ga('send', 'pageview')
<!-- SWIFTYPE -->
if current.path[0] == "docs" || current.path[0] == "search"
script.
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
_st('install','VsuU7kH5Hnnj9tfyNvfK','2.0.0');
<!-- Google Feedback -->
script(src="//www.gstatic.com/feedback/api.js" type="text/javascript")
<!-- Twitter Widget -->
script.
(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}})(document,"script","twitter-wjs");

View File

@ -19,4 +19,5 @@ html(lang="en" ng-app="angularIOApp" itemscope itemtype="http://schema.org/Frame
!= yield != yield
!= partial("/_includes/_footer") != partial("/_includes/_footer")
!= partial("/_includes/_scripts-include") != partial("/_includes/_scripts-include")
!= partial("/_includes/_scripts-minimum")

View File

@ -63,9 +63,9 @@
nav(class="sidenav l-pinned-left l-layer-4 l-offset-nav" ng-class="appCtrl.showDocsNav ? 'is-visible' : ''") nav(class="sidenav l-pinned-left l-layer-4 l-offset-nav" ng-class="appCtrl.showDocsNav ? 'is-visible' : ''")
// SEARCH BAR // SEARCH BAR
header.sidenav-search.st-input-wrapper header.sidenav-search.st-input-wrapper
form.st-input-inner .st-input-inner
label(for="search-io" class="is-hidden") Search Docs label(for="search-io" class="is-hidden") Search Docs
input(type="search" id="search-io" placeholder="SEARCH DOCS...") input(type="text" class="st-default-search-input" placeholder="SEARCH DOCS...")
button(class="mobile-trigger button" aria-label="View Docs Menu" ng-click="appCtrl.toggleDocsMenu($event)" md-button) Docs <span class="icon icon-arrow-drop-down"></span> button(class="mobile-trigger button" aria-label="View Docs Menu" ng-click="appCtrl.toggleDocsMenu($event)" md-button) Docs <span class="icon icon-arrow-drop-down"></span>
ul(class="sidenav-links") ul(class="sidenav-links")

View File

@ -49,3 +49,4 @@ else
include ../_includes/_footer include ../_includes/_footer
include ../_includes/_scripts-include include ../_includes/_scripts-include
include ../_includes/_scripts-minimum

View File

@ -5,7 +5,7 @@ if jade2ng
!= partial("../_includes/_hero") != partial("../_includes/_hero")
!= partial("../_includes/_banner") != partial("../_includes/_banner")
.l-content-small.grid-fluid.docs-content .l-content-small.grid-fluid.docs-content
!= yield != yield
else else
doctype doctype
html(lang="en" ng-app="angularIOApp" itemscope itemtype="http://schema.org/Framework") html(lang="en" ng-app="angularIOApp" itemscope itemtype="http://schema.org/Framework")
@ -41,4 +41,5 @@ else
!= partial("../_includes/_next-item") != partial("../_includes/_next-item")
!= partial("../_includes/_footer") != partial("../_includes/_footer")
!= partial("../_includes/_scripts-include") != partial("../_includes/_scripts-include")
!= partial("../_includes/_scripts-minimum")

View File

@ -48,6 +48,7 @@
@import 'module/card'; @import 'module/card';
@import 'module/hover-card'; @import 'module/hover-card';
@import 'module/modal'; @import 'module/modal';
@import 'module/search';
@import 'module/shadow'; @import 'module/shadow';
@import 'module/showcase'; @import 'module/showcase';
@import 'module/statement'; @import 'module/statement';

View File

@ -0,0 +1,47 @@
/*
* Search Module
*
* Module for search input and results
*
*/
/*
* Variables
*/
$unit: 8px !default;
$search-field: '.search-field';
$search-results: '.search-results';
$search-height: 104px;
$search-width: 752px;
/*
* Class
*/
#{$search-results} {
#{$search-field} {
background: $white;
border: 1px solid $blue-grey-100;
border-radius: 2px;
box-sizing: border-box;
color: $blue-grey-500;
font-size: 16px;
height: $unit * 5;
margin-bottom: $unit * 4;
padding: 0 $unit;
width: 100%;
&:active,
&:focus {
background: rgba($amber-50, .24);
border: 1px solid $blue-500;
color: $blue-500;
}
}
}

View File

@ -80,6 +80,7 @@ $sidenav-width: 240px;
} }
input { input {
background: $white;
border: none; border: none;
border-radius: 200px; border-radius: 200px;
box-sizing: border-box; box-sizing: border-box;

6
public/search/_data.json Normal file
View File

@ -0,0 +1,6 @@
{
"index": {
"title": "Search Results",
"subtitle": "Developer Documentation"
}
}

View File

@ -0,0 +1,16 @@
doctype html public
html(lang="en")
head
!= partial("../_includes/_head-include")
body.l-offset-nav
!= partial("../_includes/_main-nav")
!= partial("../_includes/_hero")
article(class="l-docs-content")
!= yield
!= partial("../_includes/_footer")
!= partial("../_includes/_scripts-minimum")

3
public/search/index.jade Normal file
View File

@ -0,0 +1,3 @@
.search-results
input(type="text" class="st-default-search-input search-field" placeholder="SEARCH DOCS...")
.st-search-container