Initial website
This commit is contained in:
12
themes/hueman/layout/search/baidu.ejs
Normal file
12
themes/hueman/layout/search/baidu.ejs
Normal file
@@ -0,0 +1,12 @@
|
||||
<form class="search-form" method="GET" action="https://www.baidu.com/s?">
|
||||
<input name="wd" type="text" class="search-form-input" placeholder="<%= __('index.search') %>" />
|
||||
</form>
|
||||
<script>
|
||||
(function ($) {
|
||||
$('.search-form').on('submit', function (e) {
|
||||
var keyword = $('.search-form-input[name="wd"]').val();
|
||||
window.location = 'https://www.baidu.com/s?wd=site:<%= config.url.replace(/http(s)*:\/\//, "") %> ' + keyword;
|
||||
return false;
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
18
themes/hueman/layout/search/index.ejs
Normal file
18
themes/hueman/layout/search/index.ejs
Normal file
@@ -0,0 +1,18 @@
|
||||
<div id="search-form-wrap">
|
||||
<% if (theme.search.insight) { %>
|
||||
<form class="search-form">
|
||||
<input type="text" class="ins-search-input search-form-input" placeholder="<%= __('index.search') %>" />
|
||||
<button type="submit" class="search-form-submit"></button>
|
||||
</form>
|
||||
<%- partial('search/insight') %>
|
||||
<% } else if (theme.search.swiftype) { %>
|
||||
<div class="search-form">
|
||||
<input type="text" class="st-default-search-input search-form-input" placeholder="<%= __('index.search') %>" />
|
||||
</div>
|
||||
<%- partial('search/swiftype') %>
|
||||
<% } else if (theme.search.baidu) { %>
|
||||
<%- partial('search/baidu') %>
|
||||
<% } else { %>
|
||||
<%- search_form({text: __('index.search')}) %>
|
||||
<% } %>
|
||||
</div>
|
29
themes/hueman/layout/search/insight.ejs
Normal file
29
themes/hueman/layout/search/insight.ejs
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="ins-search">
|
||||
<div class="ins-search-mask"></div>
|
||||
<div class="ins-search-container">
|
||||
<div class="ins-input-wrapper">
|
||||
<input type="text" class="ins-search-input" placeholder="<%= __('insight.hint') %>" />
|
||||
<span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
|
||||
</div>
|
||||
<div class="ins-section-wrapper">
|
||||
<div class="ins-section-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function (window) {
|
||||
var INSIGHT_CONFIG = {
|
||||
TRANSLATION: {
|
||||
POSTS: '<%= __("insight.posts") %>',
|
||||
PAGES: '<%= __("insight.pages") %>',
|
||||
CATEGORIES: '<%= __("insight.categories") %>',
|
||||
TAGS: '<%= __("insight.tags") %>',
|
||||
UNTITLED: '<%= __("insight.untitled") %>',
|
||||
},
|
||||
ROOT_URL: '<%= config.root %>',
|
||||
CONTENT_URL: '<%- url_for("/content.json")%>',
|
||||
};
|
||||
window.INSIGHT_CONFIG = INSIGHT_CONFIG;
|
||||
})(window);
|
||||
</script>
|
||||
<%- js('js/insight') %>
|
26
themes/hueman/layout/search/swiftype.ejs
Normal file
26
themes/hueman/layout/search/swiftype.ejs
Normal file
@@ -0,0 +1,26 @@
|
||||
<script type="text/javascript">
|
||||
(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','<%= theme.search.swiftype %>','2.0.0');
|
||||
</script>
|
||||
<style>
|
||||
.st-ui-injected-overlay-container,
|
||||
.st-ui-injected-overlay-container *:not(select) {
|
||||
font-family: inherit !important;
|
||||
}
|
||||
section.st-ui-content.st-search-results a.st-ui-result .st-ui-type-heading {
|
||||
color: <%= theme.customize.theme_color %> !important;
|
||||
}
|
||||
.st-ui-injected-overlay-container .st-ui-header input[type="text"]:focus {
|
||||
border-bottom: 2px solid <%= theme.customize.theme_color %>;
|
||||
}
|
||||
.st-ui-injected-overlay-container .st-ui-footer a.st-ui-pagination-link {
|
||||
color: <%= theme.customize.theme_color %>;
|
||||
}
|
||||
.st-ui-injected-overlay-container .st-ui-footer a.st-ui-pagination-link span.st-ui-arrow {
|
||||
border-color: <%= theme.customize.theme_color %>;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user