ジキルには、excerpt_separator
というオプションがあります。これはあなたに適しています。 _config.yml
で
:
excerpt_separator: <!--more--> # you can specify your own separator, of course.
あなたにポスト: 物事はこのように行く
---
layout: post
title: Foo
---
This appears in your `index.html`
This appears, too.
<!--more-->
This doesn't appear. It is separated.
あなたは正確に<!--more-->
、ない<!--More-->
または<!-- more -->
を入力する必要があります。で
あなたindex.html
:
<!-- Loop in you posts -->
{% for post in site.posts %}
<!-- Here's the header -->
<header>
<h2 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
</header>
<!-- Your post's summary goes here -->
<article>{{ post.excerpt }}</article>
{% endfor %}
出力は次のようなものです:jekyllのgithubのバージョンごとのポストexcerpt_separator
ので、あなたが参照を追加する必要がサポートしてい
<header>
<h2 class="title"><a href="Your post URL">Foo</a></h2>
</header>
<article>
This appears in your `index.html`
This appears, too.
</article>
@kaplanこれは、より適切な答えです。それは受け入れられるべきです。 – kleinfreund
@kleinfreund実際、最初の回答が受け入れられてから数ヶ月後に私はその質問に答えました。 –
私はそれを知っています。それが私がコメントした理由です。それはより適切な答えです。 – kleinfreund