How to pass {

后端 未结 2 1814
心在旅途
心在旅途 2021-02-18 22:48

I am trying to rebuild a blog in Jekyll and I have stubled upon a simple task.

Provided I have the following set of templates:

default.html:

2条回答
  •  离开以前
    2021-02-18 22:53

    If your use-case is like mine and you want to include add'l content inside your template, you can include multiline content from your front matter into the template using YAML's block scalar feature. A | keeps line-breaks while a > removes ("folds") line-breaks. (Note that the block indicator must be followed by a blank line.)

    index.html

    ---
    layout: default
    head: |
      
      
    script: |
      
      
    ---
    
    

    default.html

    
    
    
      
        {{page.title}}
      
      
    
      
      {{ page.head }}
    
    
      {{content}}
    
      
    
      
      {{page.script}}
    
    
    

提交回复
热议问题