icarus 283 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. commit 99a47ee8d0b1301b4708efc0467e793b31d284a5
  2. Author: ppoffice <ppoffice_2008@163.com>
  3. Date: Thu Apr 7 10:53:51 2016 +0800
  4. chore: add insight search hash support & fix commit counter link issue
  5. diff --git a/layout/comment/counter.ejs b/layout/comment/counter.ejs
  6. index 0c64cda..5684d4d 100644
  7. --- a/layout/comment/counter.ejs
  8. +++ b/layout/comment/counter.ejs
  9. @@ -1,9 +1,9 @@
  10. <% if (post.comments) { %>
  11. <% if (theme.comment.disqus) { %>
  12. - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link disqus-comment-count" data-disqus-url="<%= url_for(post.permalink) %>"><%= __('article.comments') %></a>
  13. + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link disqus-comment-count" data-disqus-url="<%= url_for(post.path) %>"><%= __('article.comments') %></a>
  14. <% } else if (theme.comment.duoshuo) { %>
  15. - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link ds-thread-count" data-thread-key="<%= post.path %>"><%= __('article.comments') %></a>
  16. + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link ds-thread-count" data-thread-key="<%= post.path %>"><%= __('article.comments') %></a>
  17. <% } else if (theme.comment.youyan) { %>
  18. - <a href="<%- url_for(post.permalink) %>#comments" class="article-comment-link"><%= __('article.comments') %></a>
  19. + <a href="<%- url_for(post.path) %>#comments" class="article-comment-link"><%= __('article.comments') %></a>
  20. <% } %>
  21. <% } %>
  22. \ No newline at end of file
  23. diff --git a/layout/search/insight.ejs b/layout/search/insight.ejs
  24. index 26ca74a..aa3f250 100644
  25. --- a/layout/search/insight.ejs
  26. +++ b/layout/search/insight.ejs
  27. @@ -13,9 +13,9 @@
  28. <script>
  29. (function ($) {
  30. $main = $('.ins-search');
  31. + $container = $('.ins-section-container');
  32. $main.parent().remove('.ins-search');
  33. $('body').append($main);
  34. - $container = $('.ins-section-container');
  35. $(document).on('click focus', '.search-form-input', function () {
  36. $main.addClass('show');
  37. @@ -26,7 +26,6 @@
  38. $main.removeClass('show');
  39. });
  40. -
  41. function section (title) {
  42. return $('<section>').addClass('ins-section')
  43. .append($('<header>').addClass('ins-section-header').text(title));
  44. @@ -190,6 +189,9 @@
  45. }
  46. $.getJSON('<%- url_for("/content.json")%>', function (json) {
  47. + if (location.hash.trim() == '#ins-search') {
  48. + $main.addClass('show');
  49. + }
  50. $('.ins-search-input').on('input', function () {
  51. var keywords = $(this).val();
  52. searchResultToDOM(search(json, keywords));