What are the differences between a post and a page in Jekyll?

后端 未结 2 1640
孤城傲影
孤城傲影 2021-02-13 15:39

I am using Jekyll. What are the differences between a post and a page? As far as I can see:

  1. they both can contain YAML front matter, and
  2. a post has a date
2条回答
  •  执念已碎
    2021-02-13 16:23

    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).

提交回复
热议问题