Skip to content

官方教程中存在错误 #26

Closed
Closed
@308299160

Description

@308299160

在“Implementing the blog engine”这部分。
blog.mustache这个文件中有:
<h2 class="article-title"><a href="/article/{{id}}">{{title}}</a></h2>
然而在后面给出的RenderedArticle代码里面,不存在id这个字段。在github里面blog.mustache的代码则是
<h2 class="article-title"><a href="/article/{{slug}}">{{title}}</a></h2>

其次,blog.mustache和header.mustache文件中都引用了{{title}},但是在HtmlController中却是:
@GetMapping("/") fun blog(model: Model): String { model["articles"] = repository.findAllByOrderByAddedAtDesc().map { it.render() } return "blog" }
没有title。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions