#9 Adding code highlight js

This commit is contained in:
2015-09-17 17:13:09 +08:00
parent 805ee39a28
commit e4fcdc1ae2
2 changed files with 10 additions and 2 deletions
@@ -4,3 +4,9 @@
#= require bootstrap-sprockets
#= require_tree .
$ ->
hljs.initHighlightingOnLoad();
$('pre').each (i, block)->
hljs.highlightBlock(block)
+4 -2
View File
@@ -14,7 +14,8 @@
<%= stylesheet_link_tag 'published_posts/published_post', 'data-turbolinks-track' => true %>
<!-- Custom Fonts -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/fontawesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/8.8.0/styles/solarized_dark.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@@ -71,7 +72,6 @@
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1><%= @post.title %></h1>
<h7 class="subheading"><%= @post.summary %></h7>
<span class="meta">分享于<%= time_ago_in_words @post.created_at %>之前</span>
</div>
</div>
@@ -115,7 +115,9 @@
</div>
</div>
</footer>
<script src="//cdn.jsdelivr.net/highlight.js/8.8.0/highlight.min.js"></script>
<%= javascript_include_tag "published_posts/post", 'data-turbolinks-track' => true %>
</body>
</html>