Skip to content

Commit b1d0990

Browse files
committed
add algolia docsearch
1 parent 6396508 commit b1d0990

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-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
@@ -166,6 +166,34 @@ a.button
166166
border-right 4px solid transparent
167167
border-top 5px solid #ccc
168168

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

themes/vue/source/js/common.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@
2020
*/
2121

2222
function initSearch () {
23-
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
24-
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
25-
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
26-
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
27-
28-
_st('install','HgpxvBc7pUaPUWmG9sgv','2.0.0');
23+
docsearch({
24+
apiKey: '0a75952972806d9ad07e387d08e9cc4c',
25+
indexName: 'vuejs_jp',
26+
inputSelector: '.st-default-search-input'
27+
});
2928
}
3029

3130
/**

0 commit comments

Comments
 (0)