diff --git a/.gitignore b/.gitignore index 4e9dc70..437d989 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ src/jekyll/_knosys/ src/jekyll/_assets/*/ksio/ src/jekyll/_site/ +src/hexo/source/_data/knosys/ +src/hexo/source/knosys/ +src/hexo/source/_posts/ src/hexo/themes/lime/source/*/ksio/ src/hexo/Thumbs.db src/hexo/db.json diff --git a/src/hexo/_config.yml b/src/hexo/_config.yml index bc92b58..5441c9c 100644 --- a/src/hexo/_config.yml +++ b/src/hexo/_config.yml @@ -13,13 +13,13 @@ timezone: Asia/Shanghai # URL ## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' -url: http://example.com +url: https://ourai.github.io/lime root: /lime/ permalink: posts/:title/ permalink_defaults: pretty_urls: - trailing_index: false # Set to false to remove trailing 'index.html' from permalinks - trailing_html: true # Set to false to remove trailing '.html' from permalinks + trailing_index: false + trailing_html: false # Directory source_dir: source diff --git a/src/hexo/themes/lime/layout/_ksio/layouts/page.ejs b/src/hexo/themes/lime/layout/_ksio/layouts/page.ejs index b85539a..ba16218 100644 --- a/src/hexo/themes/lime/layout/_ksio/layouts/page.ejs +++ b/src/hexo/themes/lime/layout/_ksio/layouts/page.ejs @@ -44,9 +44,9 @@ <% } %> - <% if (page.comments === true) { %> + <% if (theme.social && theme.social.comment && page.comments === true) { %> -
+
<%- partial('_ksio/widgets/comment') %>
<% } %> diff --git a/src/hexo/themes/lime/layout/_ksio/widgets/comment.ejs b/src/hexo/themes/lime/layout/_ksio/widgets/comment.ejs new file mode 100644 index 0000000..c512cc9 --- /dev/null +++ b/src/hexo/themes/lime/layout/_ksio/widgets/comment.ejs @@ -0,0 +1,5 @@ +<% if (theme.social && theme.social.comment) { %> + <% if (theme.social.comment.disqus) { %> + <%- partial('_ksio/widgets/disqus') %> + <% } %> +<% } %> diff --git a/src/hexo/themes/lime/layout/_ksio/widgets/disqus.ejs b/src/hexo/themes/lime/layout/_ksio/widgets/disqus.ejs new file mode 100644 index 0000000..580be91 --- /dev/null +++ b/src/hexo/themes/lime/layout/_ksio/widgets/disqus.ejs @@ -0,0 +1,42 @@ +<% const comment_config = theme.social && theme.social.comment && theme.social.comment.disqus %> +<% const disqus_shortname = comment_config && env.env === 'production' ? comment_config.shortname : '' %> +<% if (comment_config && disqus_shortname) { %> + <% const page_url = page.permalink %> + <% const page_id = page_url.replace(config.url, '') %> +
+ <% if (comment_config.proxy) { %> + <%- js('javascripts/ksio/vendors/disqusjs.min') %> + + <% } else { %> + + + + <% } %> +<% } %> diff --git a/src/hexo/themes/lime/layout/_ksio/widgets/share.ejs b/src/hexo/themes/lime/layout/_ksio/widgets/share.ejs new file mode 100644 index 0000000..410f7a5 --- /dev/null +++ b/src/hexo/themes/lime/layout/_ksio/widgets/share.ejs @@ -0,0 +1,8 @@ +<% if (site.ksio.social.share !== false) { %> +
+
+

分享到

+ +
+
+<% } %> diff --git a/src/hexo/themes/lime/layout/_ksio/widgets/toc.ejs b/src/hexo/themes/lime/layout/_ksio/widgets/toc.ejs new file mode 100644 index 0000000..5f82ebf --- /dev/null +++ b/src/hexo/themes/lime/layout/_ksio/widgets/toc.ejs @@ -0,0 +1,6 @@ +
+
+

目录

+
+
+
diff --git a/src/jekyll/_includes/ksio/widgets/disqus.html b/src/jekyll/_includes/ksio/widgets/disqus.html index 0419724..9eb8794 100644 --- a/src/jekyll/_includes/ksio/widgets/disqus.html +++ b/src/jekyll/_includes/ksio/widgets/disqus.html @@ -24,9 +24,9 @@ {% else %}