Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

官方教程中存在错误 #26

Closed
308299160 opened this issue Mar 13, 2019 · 3 comments
Closed

官方教程中存在错误 #26

308299160 opened this issue Mar 13, 2019 · 3 comments

Comments

@308299160
Copy link

308299160 commented Mar 13, 2019

在“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。

@sdeleuze
Copy link
Collaborator

Hey, any chance you could translate the issue title and description to english?

@308299160
Copy link
Author

I try my best!
There was an error in the official tutorial !
In this section "Implementing the blog engine" in official tutorial,
{{id}} is used in the blog.mustache file, id property is not found in RenderedArticle.class.
{{slug}} is used in the blog.mustache in github.

In addition, {{title}} is used in both blog.mustache and header.mustache, but in HtmlController
fun blog(model: Model): String {
model["articles"] = repository.findAllByOrderByAddedAtDesc().map { it.render() }
return "blog"
}
there is no model["title"].

Can you see what I mean
url of official tutorial: https://spring.io/guides/tutorials/spring-boot-kotlin/

@sdeleuze
Copy link
Collaborator

Fixed, thanks for spotting this, and your english is as good as mine ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants