rust-rocket-tera-extends-which-doesn't-exist-or-isn't-loaded

rocket tera:base.html which doesn't exist or isn't loaded.

头像
逆旅 2022-08-04T17:25:01

按照官方教程引入模版 base.html.tera

{% extends "base.html" %}
{% block title %}Index{% endblock title %}
{% block head %}
    {{/* super() */}}
    <style type="text/css">
        .important { color: #336699; }
    </style>
{% endblock head %}
{% block content %}
    Index
    <p class="important">
      Welcome to my awesome homepage.
    </p>
{% endblock content %}
-----------------------------------
Rust模板引擎Tera中文英文对照官方文档
https://blog.51cto.com/u_14256460/2509111

报错:

Template 'index' is inheriting from 'base.html', which doesn't exist or isn't loaded.`

找了一下rocket 的issues
发现解决办法:点击

修改一下

{% extends "base" %}
最后修改: 2022-10-28T15:40:06

版权声明:署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)

comment 评论

验证图片
评论
仿 Valine