diff --git a/_config.yml b/_config.yml index f6955d7..a593141 100644 --- a/_config.yml +++ b/_config.yml @@ -71,4 +71,25 @@ busuanzi_count: # custom pv span for one page only page_pv: false page_pv_header: - page_pv_footer: \ No newline at end of file + page_pv_footer: + + +# Local Search +# Dependencies: https://github.com/theme-next/hexo-generator-searchdb +local_search: + enable: true + # If auto, trigger search by changing input. + # If manual, trigger search by pressing enter key or search button. + trigger: auto + # Show top n results per article, show all results by setting to -1 + top_n_per_article: 1 + # Unescape html strings to the readable one. + unescape: false + # Preload the search data when the page loads. + preload: false + + +# Assets +css: css +js: js +images: images \ No newline at end of file diff --git a/languages/en.yml b/languages/en.yml index a8e05d0..2da9b17 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -17,5 +17,5 @@ tag: Tag home: Home archive: Archives about: About -site_uv: "UV: " -site_pv: "PV: " \ No newline at end of file +site_uv: UV +site_pv: PV \ No newline at end of file diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index e30d960..1117350 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -17,5 +17,5 @@ tag: 标签 home: 首页 archive: 归档 about: 关于 -site_uv: 访问人数: -site_pv: 总访问量: \ No newline at end of file +site_uv: 访问人数 +site_pv: 总访问量 \ No newline at end of file diff --git a/layout/common/head.ejs b/layout/common/head.ejs index 1e708bf..a6684cb 100644 --- a/layout/common/head.ejs +++ b/layout/common/head.ejs @@ -28,4 +28,6 @@ <%- favicon_tag(theme.favicon) %> <% } %> <%- css('css/style') %> + <%- export_config() %> + diff --git a/layout/common/local-search.ejs b/layout/common/local-search.ejs new file mode 100644 index 0000000..f4da160 --- /dev/null +++ b/layout/common/local-search.ejs @@ -0,0 +1,27 @@ +
\ No newline at end of file diff --git a/layout/common/nav.ejs b/layout/common/nav.ejs index b886f8b..b2f7b9a 100644 --- a/layout/common/nav.ejs +++ b/layout/common/nav.ejs @@ -20,4 +20,8 @@ <% } %> + <% if (theme.local_search.enable) { %> + + <%- next_js('local-search.js') %> + <% } %> \ No newline at end of file diff --git a/layout/layout.ejs b/layout/layout.ejs index 4c7ce5b..9c8f427 100644 --- a/layout/layout.ejs +++ b/layout/layout.ejs @@ -3,6 +3,12 @@ <%- partial('common/head') %> <%- body %> +