这是我对 Home.html
的代码<br/><br/>
{{#each blog.recent_posts}}
<br/><br/>
{{> components/blog/post post=this settings=../settings}}
<br/><br/>
{{/each}}
这是我对 Post.html
的代码<br/>
<"header class="blog-header"><br/>
<"/h2 class="blog-title"><br/>
<"img src="{{getImage thumbnail 'blog_size'}}" alt="{{thumbnail.alt}}" title="{{thumbnail.alt}}">
<br/>
<a href="{{post.url}}">{{post.title}}</a><br/>
</h2>
<br/>
<p class="blog-date">{{#if post.author}}{{lang 'blog.posted_by' name=post.author}} on {{/if}}{{post.date_published}}</p><br/>
</header>
<br/>
答案 0 :(得分:1)
您的标记似乎存在一些语法问题。
{{#each blog.recent_posts}}
{{> components/blog/post post=this settings=../settings}}
{{/each}}
Post.html
<header class="blog-header">
<h2 class="blog-title">
{{post.title}}
</h2>
<img src="{{getImage thumbnail 'blog_size'}}" alt="{{thumbnail.alt}}" title="{{thumbnail.alt}}">
{{#if post.author}}
{{lang 'blog.posted_by' name=post.author}} on
{{/if}}
{{post.date_published}}
</header>
答案 1 :(得分:0)
在模板中,您需要删除帖子。因为全球blog.recent_posts结构如果与blog.posts不同并且由于某种原因。
WebElement myDynamicElement = (new WebDriverWait(driver, 10)).until(ExpectedConditions.presenceOfElementLocated(By.className("big-number")));
// It will print the text of the Element:
system.out.println(myDynamicElement.getText());