渲染时布局无法使用元数据

时间:2014-01-10 01:02:10

标签: pug docpad

所以我第一次玩docpad并且有一个类似于下面的文档

--- yaml
title: "Test"
layout: "default"
---

default.html.jade

html
  title= title
body
  h1= title
  p= layout
  != content
 code= JSON.stringify(locals)

但是我最终得到的页面没有标题或布局变量的内容。转储显示它们是我应该期望的值。

1 个答案:

答案 0 :(得分:1)

所以我很笨,文档的元数据可以在文档对象中找到。

我需要使用document.title

title
相关问题