Skip to content

Commit f67d83f

Browse files
committed
add swiftype
1 parent 7d5fbd5 commit f67d83f

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<li>
22
<form id="search-form">
3-
<input type="text" id="search-query">
3+
<input type="text" id="search-query" class="st-default-search-input">
44
</form>
55
</li>
66
<li><a href="/guide/" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li>
77
<li><a href="/api/" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API Reference</a></li>
88
<li><a href="/examples/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
99
<li><a href="/blog/" class="nav-link<%- (page.path.match(/blog/) || is_post()) ? ' current' : '' %>">Blog</a></li>
10-
<li><a href="https://github.com/yyx990803/vue" target="_blank" class="nav-link">GitHub</a></li>
10+
<li><a href="https://github.com/yyx990803/vue" target="_blank" class="nav-link">GitHub</a></li>

themes/vue/source/js/common.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,13 @@
135135
}
136136
}
137137

138-
// Search
138+
// Search with SwiftType
139139

140-
var postfix = encodeURI(' site:vuejs.org')
141-
document.getElementById('search-form').addEventListener('submit', function (e) {
142-
e.preventDefault()
143-
var query = document.getElementById('search-query').value.trim()
144-
if (query) {
145-
window.location.href = 'https://www.google.com/search?q=' + query + postfix
146-
}
147-
})
140+
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
141+
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
142+
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
143+
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
144+
145+
_st('install','HgpxvBc7pUaPUWmG9sgv','2.0.0');
148146

149-
})()
147+
})()

0 commit comments

Comments
 (0)