Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为在单个页面上多次使用的组件创建一个模板,更改很少(只需 2 或 3 个变量)。如何创建此模板并将其呈现在另一个模板中?
包括怎么样?
像这样:
{% include "name_snippet.html" with person="Jane" greeting="Hello" %}
我们通常为此创建一个自定义包含标签。