コンテンツ ディレクトリに 2 つの投稿があるとします。
content/
├── post1.md
└── post2.md
タイトルは同じでも著者/内容が異なるもの。
post1.md
Title: Oi
Author: Dr. Jekyll
Date: 2015-07-15 10:30
Category: StackOverflow
Tags: pelican
"Well, I tell you so again," continued the lawyer. "I have been
learning something of young Hyde."
The large handsome face of Dr. Jekyll grew pale to the very lips,
and there came a blackness about his eyes. "I do not care to hear
more," said he. "This is a matter I thought we had agreed to drop."
post2.md
Title: Oi
Author: Mr. Hyde
Date: 2015-07-15 10:20
Category: StackOverflow
Tags: pelican
"We have common friends," said Mr. Utterson.
"Common friends?" echoed Mr. Hyde, a little hoarsely. "Who are
they?"
"Jekyll, for instance," said the lawyer.
Pelican は投稿のタイトルを使用してこれらの投稿を「スラッグ化」するため、名前の競合が発生します。
解決策は、メタデータを各投稿に追加してSlug: my-slug-line
、投稿を強制的にレンダリングすることmy-slug-line.html
です。この例では:
post1.md
Title: Oi
Author: Dr. Jekyll
Date: 2015-07-15 10:30
Category: StackOverflow
Tags: pelican
Slug: oi-dr-jekyll
"Well, I tell you so again," continued the lawyer. "I have been
learning something of young Hyde."
The large handsome face of Dr. Jekyll grew pale to the very lips,
and there came a blackness about his eyes. "I do not care to hear
more," said he. "This is a matter I thought we had agreed to drop."
post2.md
Title: Oi
Author: Mr. Hyde
Date: 2015-07-15 10:20
Category: StackOverflow
Tags: pelican
Slug: oi-mr-hyde
"We have common friends," said Mr. Utterson.
"Common friends?" echoed Mr. Hyde, a little hoarsely. "Who are
they?"
"Jekyll, for instance," said the lawyer.
これにより、Dr. Jekyll による最初の投稿が に出力さoi-dr-jekyll.html
れ、Mr. Hyde による 2 番目の投稿が に出力されoi-mr-hyde.html
ます。
メタSlug:
データはオプションであるため、名前の競合が発生しない限り、これを行う必要はありません。しかし、それは時々便利になることがあります。
また、次の点に注意してください。
Markdown で記述された「自己紹介」ページなど、非ブログまたは「静的」ページに対して同じことを行いたい場合は、メタデータを使用して、ページ タイトルがどうであれ、save_as: my_page.html
Markdown を強制的に にレンダリングすることができます。my_page.html
なれ。