site/docs/posts.md in jekyll-1.5.1 vs site/docs/posts.md in jekyll-2.0.0.alpha.1
- old
+ new
@@ -41,19 +41,31 @@
2012-09-12-how-to-write-a-blog.textile
{% endhighlight %}
### Content Formats
-All blog post files must begin with [YAML front- matter](../frontmatter/). After
+All blog post files must begin with [YAML front-matter](../frontmatter/). After
that, it's simply a matter of deciding which format you prefer. Jekyll supports
two popular content markup formats:
[Markdown](http://daringfireball.net/projects/markdown/) and
[Textile](http://textile.sitemonks.com/). These formats each have their own way
of marking up different types of content within a post, so you should
familiarize yourself with these formats and decide which one best suits your
needs.
+<div class="note info">
+ <h5>Be aware of character sets</h5>
+ <p>
+ Content processors can modify certain characters to make them look nicer.
+ For example, the <code>smart</code> extension in Redcarpet converts standard,
+ ASCII quotation characters to curly, Unicode ones. In order for the browser
+ to display those characters properly, define the charset meta value by
+ including <code><meta charset="utf-8"></code> in the
+ <code><head></code> of your layout.
+ </p>
+</div>
+
## Including images and resources
Chances are, at some point, you'll want to include images, downloads, or other
digital assets along with your text content. While the syntax for linking to
these resources differs between Markdown and Textile, the problem of working out
@@ -124,24 +136,33 @@
{% highlight html %}
<ul>
{% raw %}{% for post in site.posts %}{% endraw %}
<li>
<a href="{% raw %}{{ post.url }}{% endraw %}">{% raw %}{{ post.title }}{% endraw %}</a>
- <p>{% raw %}{{ post.excerpt }}{% endraw %}</p>
+ {% raw %}{{ post.excerpt }}{% endraw %}
</li>
{% raw %}{% endfor %}{% endraw %}
</ul>
{% endhighlight %}
+Because Jekyll grabs the first paragraph you will not need to wrap the excerpt in `p` tags,
+which is already done for you. These tags can be removed with the following if you'd prefer:
+
+{% highlight html %}
+{% raw %}{{ post.excerpt | remove: '<p>' | remove: '</p>' }}{% endraw %}
+{% endhighlight %}
+
If you don't like the automatically-generated post excerpt, it can be overridden by adding
`excerpt` to your post's YAML front-matter. Completely disable it by setting
your `excerpt_separator` to `""`.
+Also, as with any output generated by Liquid tags, you can pass the `| strip_html` flag to remove any html tags in the output. This is particularly helpful if you wish to output a post excerpt as a `meta="description"` tag within the post `head`, or anywhere else having html tags along with the content is not desirable.
+
## Highlighting code snippets
Jekyll also has built-in support for syntax highlighting of code snippets using
-Pygments, and including a code snippet in any post is easy. Just use the
-dedicated Liquid tag as follows:
+either Pygments or Rouge, and including a code snippet in any post is easy. Just
+use the dedicated Liquid tag as follows:
{% highlight text %}
{% raw %}{% highlight ruby %}{% endraw %}
def show
@widget = Widget(params[:id])