Label Cloud

Tuesday, December 16, 2008

让你的帖子首页只显示摘要

  有时候一篇blog太长了,首页只显示帖子摘要就变得很重要了。读者只需要再点击“查看全文”即可进入显示全文的帖子页。方法如下:
   English Version: make your blog post just show the compress.
   Sometime, one blog post is too long, so show the compress in frontpage is very important. The readers just need to click "Read More" to see the whole contents.

 0,进入Dashboard-你的博客名字-Settings-Archiving-Enable Post Page?选中Yes.
    1,在Dashboard-你的博客名字-Layout-Edit html定位代码:

<p><data:post.body/></p>
2,替换为以下代码:
<b:if cond='data:blog.pageType == "item"'>
<style>.fullpost{display:inline;}</style>
<p><data:post.body/></p>
<b:else/>
<style>.fullpost{display:none;}</style>
<p><data:post.body/>
<br></br>
<b:if cond='data:post.url'>
<a expr:href='data:post.url'>阅读全文...</a>
<b:else/>
<data:post.title/>
</b:if>
</p>
</b:if>

3,在blog post正文中加入如下代码:
文章摘要<span class="fullpost">文章全文</span>

No comments: