【发布时间】:2018-09-03 21:24:03
【问题描述】:
我正在尝试创建第二个行为相似的_posts(它可以链接到,它有自己的布局,它存储在_works 文件夹中,每件作品都以some-name.md 命名)。
一切都很好,除了我找不到如何访问该降价文件的 frontmatter 属性...唯一有效的变量是 {{content}} 但我想访问所有其他属性。
_config.yml
collections:
works:
output: true
layouts/work.html
---
layout: default
---
<div class="work-single">
<h1>{{ work.title }}</h1> ... doesnt work
<h2>{{ work.subtitle }}</h2> ... doesnt work
{{ content }}
</div>
_works/test-product.md
---
layout: work
date: 2018-03-25 01:00:00 +0900
category: illustration
title: A test work product image
subtitle: This is a great product
---
Here is a test of a product which uses **markdown**.
【问题讨论】:
标签: github jekyll github-pages yaml-front-matter