【发布时间】:2013-05-18 21:35:56
【问题描述】:
到目前为止,我有 index.html 页面使用 jekyll,这是引用:
---
layout: layout
title: "Posts"
---
<section class="content">
<ul class="listing">
{% for post in site.posts %}
<li>
<h1 align="center"><a href="{{ post.url }}">{{ post.title }}</a></h1>
</li>
{% endfor %}
</ul>
</section>
我要做的是在标题和链接下预览特定帖子的前 25-30 个单词。
最好的方法是什么?我实际上找到了解决方案,但我没有保存链接,现在花了 2 天时间搜索无济于事。
感谢您的帮助。
【问题讨论】:
-
设置大小就足够了吗?即在带有
width:200px; overflow:hidden的div 中?还是您希望它是字数? -
谢谢 Carrie,我相信一套尺寸就足够了。