我的问题是: 如果我有这样写的页面: (已保存home.en.md)
title: 'Home'
published: true
metadata:
keywords: 'home'
taxonomy:
category: - main
tag: - 'home'
menu: 'Home'
slug: home
process:
twig: true
routable: true
cache_enable: true
visible: true
content:
items: @root
order:
by: date
dir: desc
limit: 10
pagination: true
---
This are all our pages:
我如何以及在哪里添加树枝文字?
{% for p in page.collection %}
<h3> {{ p.title }} </h3>
{{ p.summary }}
{% endfor %}
答案 0 :(得分:1)
我通过添加
解决了这个问题template: name-of-template
在我的主题文件夹中添加了name-of-template.html.twig:
{% extends 'partials/base.html.twig' %}
{% block content %}
<ul>
{% for p in page.collection %}
<h3> {{ p.title }} </h3>
{{ p.summary }} <br>
<a href="http://example.com{{p.url}}"> {{ p.title }} </a> <br>
{# could return http://example.com/my-section/my-category/my-blog-post #}
{% endfor %}
</ul>
{% endblock %}
我希望这会对某人有所帮助!