Can Mustache Templates do template extension?

后端 未结 9 523
醉话见心
醉话见心 2021-01-30 06:39

I\'m new to Mustache.

Many templating languages (e.g., Django / Jinja) will let you extend a \"parent\" template like so...

ba

9条回答
  •  情话喂你
    2021-01-30 07:01

    You could use variables containing HTML. A "triple mustache" like {{{variable}}} will return unescaped HTML. It's not exactly the same as template extensions, but you could render frontpage-content.html and then put its output in a content variable that gets passed to base.html.

    (I added -content to the frontpage.html filename with the expectation that such a naming pattern will help keep the filenames manageable.)

提交回复
热议问题