123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- commit 99a47ee8d0b1301b4708efc0467e793b31d284a5
- Author: ppoffice <ppoffice_2008@163.com>
- Date: Thu Apr 7 10:53:51 2016 +0800
- chore: add insight search hash support & fix commit counter link issue
- diff --git a/layout/comment/counter.ejs b/layout/comment/counter.ejs
- index 0c64cda..5684d4d 100644
- --- a/layout/comment/counter.ejs
- +++ b/layout/comment/counter.ejs
- @@ -1,9 +1,9 @@
- <% if (post.comments) { %>
- <% if (theme.comment.disqus) { %>
- - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link disqus-comment-count" data-disqus-url="<%= url_for(post.permalink) %>"><%= __('article.comments') %></a>
- + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link disqus-comment-count" data-disqus-url="<%= url_for(post.path) %>"><%= __('article.comments') %></a>
- <% } else if (theme.comment.duoshuo) { %>
- - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link ds-thread-count" data-thread-key="<%= post.path %>"><%= __('article.comments') %></a>
- + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link ds-thread-count" data-thread-key="<%= post.path %>"><%= __('article.comments') %></a>
- <% } else if (theme.comment.youyan) { %>
- - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link"><%= __('article.comments') %></a>
- + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link"><%= __('article.comments') %></a>
- <% } %>
- <% } %>
- \ No newline at end of file
- diff --git a/layout/search/insight.ejs b/layout/search/insight.ejs
- index 26ca74a..aa3f250 100644
- --- a/layout/search/insight.ejs
- +++ b/layout/search/insight.ejs
- @@ -13,9 +13,9 @@
- <script>
- (function ($) {
- $main = $('.ins-search');
- + $container = $('.ins-section-container');
- $main.parent().remove('.ins-search');
- $('body').append($main);
- - $container = $('.ins-section-container');
-
- $(document).on('click focus', '.search-form-input', function () {
- $main.addClass('show');
- @@ -26,7 +26,6 @@
- $main.removeClass('show');
- });
-
- -
- function section (title) {
- return $('<section>').addClass('ins-section')
- .append($('<header>').addClass('ins-section-header').text(title));
- @@ -190,6 +189,9 @@
- }
-
- $.getJSON('<%- url_for("/content.json")%>', function (json) {
- + if (location.hash.trim() == '#ins-search') {
- + $main.addClass('show');
- + }
- $('.ins-search-input').on('input', function () {
- var keywords = $(this).val();
- searchResultToDOM(search(json, keywords));
|