1

こんにちは、昨日「Oi」というタイトルで投稿しましたが、今は別のタイトルで新しい投稿を作成しようとしていますが、古いものを台無しにしようとしています。

この警告とエラー メッセージが表示されます。

WARNING: There are 2 variants of "oi" with lang en
WARNING: Development/web_projects/weeklyUpdate/content/2015_06_06_oi.md
WARNING: Development/web_projects/weeklyUpdate/content/2015_06_07_oi.md
CRITICAL: File Development/web_projects/weeklyUpdate/output/oi.html is to be overwritten
4

2 に答える 2

5

コンテンツ ディレクトリに 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.htmlMarkdown を強制的に にレンダリングすることができます。my_page.htmlなれ。

于 2015-06-15T07:15:26.280 に答える