I created a page in locomotivecms, under my app/views/pages folders and called it page2.liquid.haml and it contains the following code.

 {% extends 'index' %}

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

I can view the index page, but I am not sure how to view page2 in the browser everything I try leads to a 404.

Any Ideas?

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top