14

ジキルを使用しています。投稿とページの違いは何ですか? 私が見る限り:

  1. どちらも YAML フロントマターを含めることができます。
  2. 投稿には日付とパーマリンクがありますが、ページにはありません。

もっと違いはありますか?

4

2 に答える 2

14

ここに違いがあります

  • 投稿ファイル名には、投稿のタイトルと日付が含まれます。ファイル名に無効な日付があると、エラーが発生します。
  • 投稿は比較可能なオブジェクトです。つまり、2 つの投稿を比較できます。比較は、投稿日と投稿スラッグによって行われます。
  • 生成された投稿とページのデフォルトの相対 URL は異なります (例:/2000/01/01/my-post.html/about.html)。
  • _postsページはどこにでも配置できますが、投稿はフォルダーの下にしか配置できません。
  • 投稿には、Liquid テンプレート (タイトル、URL、日付、ID、カテゴリ、次、前、タグ、コンテンツ) で使用するための追加のデータがあります。
  • 投稿には一意の ID があります。

投稿はブログ投稿を表します (したがって、ブログ投稿を簡単に作成するために使用されます)。ページは Web サイトのページを表します。

于 2013-02-27T18:43:33.460 に答える
1

There are couple difference mostly about how page will be generated and handled:

Post is any document living in _posts directory. If is handled by site.posts collection and final URL will be generated using permalink configured in config yaml file.

Pages are any documents living outside _posts directory - they will always remain relative path to root directory as URL.

Except of that and mentioned by you differences they both work the same. Some plugins are handling them differently, but it's up to plugin developer(there are no guidelines about this topic).

于 2013-02-26T19:48:09.663 に答える