diff --git a/app/assets/javascripts/published_posts/post.coffee b/app/assets/javascripts/published_posts/post.coffee index 1c3a04b..b06acc4 100644 --- a/app/assets/javascripts/published_posts/post.coffee +++ b/app/assets/javascripts/published_posts/post.coffee @@ -4,3 +4,9 @@ #= require bootstrap-sprockets #= require_tree . + +$ -> + hljs.initHighlightingOnLoad(); + + $('pre').each (i, block)-> + hljs.highlightBlock(block) diff --git a/app/views/layouts/post.html.erb b/app/views/layouts/post.html.erb index d35a737..b4bf4a4 100644 --- a/app/views/layouts/post.html.erb +++ b/app/views/layouts/post.html.erb @@ -14,7 +14,8 @@ <%= stylesheet_link_tag 'published_posts/published_post', 'data-turbolinks-track' => true %> - + + @@ -71,7 +72,6 @@

<%= @post.title %>

- “<%= @post.summary %>” 分享于<%= time_ago_in_words @post.created_at %>之前
@@ -115,7 +115,9 @@ + <%= javascript_include_tag "published_posts/post", 'data-turbolinks-track' => true %> +