如何在 blogspot 中,使用 syntax highlighter 3.x
執行修改範本[ 範本 -> 修改HTML -> 繼續],進入後勾選[展開小裝置範本]:
在 <head></head> 之間,加入以下 script 宣告
<!-- 設定需要載入的 script --> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shCore.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushXml.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushCss.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushJScript.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushCSharp.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushVb.js" type="text/javascript"></script> <script src="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shBrushSql.js" type="text/javascript"></script> <link href="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shCore.css" type="text/css" rel="stylesheet" /> <link href="https://sites.google.com/site/sharedvito/syntaxhighlighter3x/shThemeDefault.css" type="text/css" rel="stylesheet" /> <script src="https://sites.google.com/site/sharedvito/blogfile/blog.js" type="text/javascript"></script> <!-- 設定啟用 highlighter --> <script type="text/javascript"> SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.defaults['toolbar'] = false; //隱藏問號按鈕 SyntaxHighlighter.all() </script>
在 blogspot 在標籤頁或搜尋頁中,如何只顯部分內容
首先在修改範本中,找到下行資料
<b:include data='post' name='post'/>
將上行資料,以下面資料取代
<b:if cond='data:blog.homepageUrl != data:blog.url'> <b:if cond='data:blog.pageType != "item"'> <!-- Show article title only --> <div class='post-title'> <ul><li><a expr:href='data:post.url'><span style='color: #40007f; font-size: 18px; font-family: 微軟正黑體;'><data:post.title/></span></a></li></ul> </div> <div class='item-snippet'><data:post.snippet/></div><br/> <b:else/> <b:include data='post' name='post'/> </b:if> <b:else/> <b:include data='post' name='post'/> </b:if>
沒有留言:
張貼留言