我在集合中使用部分。像这样在文档中添加需要的内容:
```
title: Meetings and Events
layout: page
description: "This is my custom description."
tags: ['resources']
pageOrder: 3
pageclass: rc-events
```
我需要逐页自定义 CSS 类。然后你可以像这样在你的默认模板中调用它。
<div id="main" class="container <%= @document.pageclass %>">
meta应该是一样的
<meta name="description" content="<%= @document.description) %>" />
或检查您的docpad.coffee 文件并根据默认站点值和@document 值组合准备内容的辅助函数。然后你可以调用类似默认的东西:
<meta name="description" content="<%= @getPreparedDescription() %>" />
这是由这个辅助函数构建的:
# Get the prepared site/document description
getPreparedDescription: ->
# if we have a document description, then we should use that, otherwise use the site's description
@document.description or @site.description