Iterate over hashes in liquid templates

后端 未结 3 2035
别那么骄傲
别那么骄傲 2020-11-29 22:34

I\'m writing a site in Jekyll, which uses Liquid.

I have front matter for pages that I\'d like to look like this:

---
title: Designing algorithms tha         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 22:53

    I would define them like this in YAML:

    links:
      demo: http://www.github.com/copperegg/mongo-scaling-demo
    

    And then iterate:

    {% for link in page.links %}
      {{ link[0] }}
    {% endfor %}
    

提交回复
热议问题