Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过嵌套布局在Jekyll包含的模板中设置{{content}}_Jekyll_Liquid - Fatal编程技术网

通过嵌套布局在Jekyll包含的模板中设置{{content}}

通过嵌套布局在Jekyll包含的模板中设置{{content}},jekyll,liquid,Jekyll,Liquid,这可能太复杂了,可能有更好的设计,所以我愿意接受建议 基本上,我有一个默认的page.html,看起来像 。。。 {{content}} 我想要一个帖子页面,其中的内容将是所有帖子的for循环 因此,这个posts页面可以调用默认页面,将内容设置为自己的内容——如何 posts.html本身是否可以创建嵌套布局功能 将所有内容转换为捕获变量的最佳方法是什么?这似乎很复杂 你想得太多了posts.html或posts/index.html可以是一个html文件,它使用液体,顶部有一个布局。调用

这可能太复杂了,可能有更好的设计,所以我愿意接受建议

基本上,我有一个默认的page.html,看起来像

。。。 {{content}}

我想要一个帖子页面,其中的内容将是所有帖子的for循环

因此,这个posts页面可以调用默认页面,将内容设置为自己的内容——如何

  • posts.html本身是否可以创建嵌套布局功能
  • 将所有内容转换为捕获变量的最佳方法是什么?这似乎很复杂

    • 你想得太多了
      posts.html
      posts/index.html
      可以是一个html文件,它使用液体,顶部有一个
      布局
      。调用liquid并不妨碍文件使用布局

      我不确定嵌套布局是否也可以,但语法肯定是相同的