2008年4月27日 星期日

繼續閱讀功能


  Blogger的功能很陽春,但是可以修改HTML,這是最大的優點,讓打造部落格的空間變得很自由。今天終於找到一篇繼續閱讀功能設定的教學,以前試過別的方法都失敗,這次總算是成功了。在這裡把這個方法記錄一下。

1. 先到版面配置 -> 修改HTML
找到]]>
</b:skin>這行, 並在它跟</head>之間加上下面這段

<!-- Style to implement "Read more on this Article" link in all the posts (Start) -->
<style>
<b:if cond='data:blog.pageType == "item"'>
span.fullpost {display:inline;}
<b:else/>
span.fullpost {display:none;}
</b:if>
</style>
<!-- Style to implement "Read more on this Article" link in all the posts (End) -->

2. 儲存 -> 點一下展開小裝置範本
<data:post.body/>後面加上下面這段

<!-- Code to show "Read more on this article..." Link (Begin) -->
<b:if cond='data:blog.pageType != "item"'>
<span>
<a expr:href='data:post.url' style='color:#0000FF; text-align:right; font-weight:bold; text-decoration:none' >Read more on this article...</a>
</span>
</b:if>
<!-- Code to show "Read more on this article..." Link (End) -->

前製作業到這邊就完成了
因為預設是英文, 所以可以自己把上面的"Read more on this article..."
改成"繼續閱讀" 對字型顏色不滿意也是改上面
<a expr:那串就可以了

3. 以後每次發文的時候如果只想要顯示前面五行字
就在第六行開始之前加上<span class="fullpost">並在文章結尾加上</span>

沒有留言: