0

我在 locomotivecms 中的 app/views/pages 文件夹下创建了一个页面,并将其命名为 page2.liquid.haml,它包含以下代码。

 {% extends 'index' %}

{% block 'main' %}This is the content for the page 2{% endblock %}

我可以查看索引页面,但我不确定如何在浏览器中查看 page2 我尝试的所有操作都会导致 404。

有任何想法吗?

4

1 回答 1

1

Above the liquid markup, you need to have a YAML file header with the page's title, slug, and published flag, like this:

---
title: Page 2
slug: page2
published: true
---
{% extends 'index' %}

{% block 'main' %}This is the content for the page 2{% endblock %}

You can create files with such headers generated automatically by using the wagon generate page command.

$ bundle exec wagon generate page test_page
于 2013-10-14T00:50:04.953 回答