2008年2月22日 星期五

替 Blogger 增加讀全文佮程序區个功能

參考這篇:替Blogger加上閱讀全文(Read more...)的功能
佮這篇:在文章裡顯示優質的程式碼

讀全文ê部分我改下跤這段 (共原版精差个部份用紅色標示):
<div class='entry'>

<b:if cond='data:blog.pageType == "item"'>
<style>.fullpost{display:inline;}</style>
<p><data:post.body/></p>
<b:else/>
<style>.fullpost{display:none;}</style>

<data:post.body/>

<a expr:href='data:post.url'>閱讀全文...</a>
</b:if>

<div style='clear: both;'/> <!-- clear for photos floats -->
</div>


程序區ê部分我改下跤這段
CODE {
display: block; /* fixes a strange ie margin bug */
font-family: Courier New;
font-size: 8pt;
overflow:auto;
background: #f0f0f0 url(http://klcintw.images.googlepages.com/Code_BG.gif) left top repeat-y;
border: 1px solid #ccc;
padding: 10px 10px 10px 21px;
max-height:200px;
line-height: 1.2em;
}


這裡輸入顯示摘要的文章段落
< span class="fullpost">
這裡輸入剩餘的文章內容
< /span>

沒有留言: