diff --git a/README.md b/README.md index 0e24723..fa9d3c5 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ banner: http://example.com/banner.jpg ### Custom Categories & Tags Pages -To enable custom categories page and tags page, just copy the `categories` folder and `tags` folder under your theme's `_source` foler into your site's `source` folder. Then edit theme's _config.yml and add the following lines: +To enable custom categories page and tags page, just copy the `categories` folder and `tags` folder under your theme's `_source` foler into your site's `source` folder. Then edit theme's _config.yml and add the following lines: ```r # Header menu: @@ -140,6 +140,20 @@ English and Simplified Chinese are the default languages of the theme. You can a language: zh-CN ``` +## Swiftype + +You can now enable **Swiftype** by editing blog's `_config.yml`. + +``` yml +swiftype_install_key: XXX_XXXXXXXXXXXXXXXX +``` + +This `install key` can be found at your own engine's install page: + +![](http://ppoffice.github.io/hexo-theme-icarus/gallery/swiftype_install.jpg "") + +Finally, don't forget to save your swiftype configuration to complete the installation. + ## Features ### Profile Sidebar diff --git a/_config.yml.site.example b/_config.yml.site.example index 744faa6..887211d 100644 --- a/_config.yml.site.example +++ b/_config.yml.site.example @@ -76,6 +76,8 @@ theme: icarus # DuoShuo # duoshuo_shortname: hexo-theme-icarus +# Swiftype +# swiftype_install_key: XXX_XXXXXXXXXXXXXXXX # Deployment ## Docs: http://hexo.io/docs/deployment.html diff --git a/layout/_partial/after-footer.ejs b/layout/_partial/after-footer.ejs index 0ebafce..f0ad30d 100644 --- a/layout/_partial/after-footer.ejs +++ b/layout/_partial/after-footer.ejs @@ -18,12 +18,23 @@ ds.type = 'text/javascript';ds.async = true; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; - (document.getElementsByTagName('head')[0] + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); <% } %> +<% if (config.swiftype_install_key) { %> + +<% } %> + <%- partial('cdn_after_footer') %> <% if (theme.fancybox){ %> diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index b616759..dc012a0 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -15,7 +15,14 @@ <% } %>