Skip to content

Commit cfb6496

Browse files
committed
Merge pull request #235 from maxiloc/add-algolia-doc-search
Add Algolia docsearch
2 parents e15db45 + 200167c commit cfb6496

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

themes/vue/layout/layout.ejs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
99
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Roboto Mono' rel='stylesheet' type='text/css'>
1010
<link href='http://fonts.googleapis.com/css?family=Dosis:300,500&text=Vue.js' rel='stylesheet' type='text/css'>
11+
<link href="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" rel='stylesheet' type='text/css'>
1112
<link rel="icon" href="/images/logo.png" type="image/x-icon">
1213
<script>
1314
window.PAGE_TYPE = "<%- page.type %>"
1415
</script>
1516
<%- css(isIndex ? 'css/index' : 'css/page') %>
1617
<%- partial('partials/ga') %>
18+
<script type="text/javascript" src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
1719
<script src="/js/vue.js"></script>
1820
</head>
1921
<body>

themes/vue/source/css/_common.styl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,34 @@ a.button
165165
border-right 4px solid transparent
166166
border-top 5px solid #ccc
167167

168+
.algolia-autocomplete
169+
line-height: normal
170+
171+
@media (min-width: 768px)
172+
.aa-dropdown-menu
173+
min-width: 515px
174+
175+
.algolia-docsearch-suggestion
176+
border-color: #42b983
177+
178+
.algolia-docsearch-suggestion--subcategory-column
179+
border-color: #42b983
180+
181+
.algolia-docsearch-suggestion--category-header
182+
background: #42b983
183+
184+
.algolia-docsearch-footer
185+
border-color: #42b983
186+
187+
.algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight
188+
background rgba(255, 255, 255, 0.6)
189+
190+
.algolia-docsearch-suggestion--highlight
191+
color: #2c815b
192+
193+
.aa-cursor .algolia-docsearch-suggestion--content
194+
color: #000
195+
168196
#donate
169197
height 24px
170198
.wrapper

themes/vue/source/js/common.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
*/
1313

1414
function initSearch () {
15-
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
16-
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
17-
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
18-
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
19-
20-
_st('install','HgpxvBc7pUaPUWmG9sgv','2.0.0');
15+
docsearch({
16+
appId: 'BH4D9OD16A',
17+
apiKey: '85cc3221c9f23bfbaa4e3913dd7625ea',
18+
indexName: 'vuejs',
19+
inputSelector: '#search-query'
20+
});
2121
}
2222

2323
/**

0 commit comments

Comments
 (0)