【发布时间】:2020-03-23 13:36:07
【问题描述】:
我有一个 Wicket 应用程序,它在标题中包含大量 Javascript。我想在任何<script> 标签之前呈现我的<meta> 标签(我正在尝试添加这些标签以被搜索引擎索引,如果它们位于顶部,则更容易阅读 来源)
我认为这会对我有所帮助(在我的 BasePage 中)
public void renderHead(final IHeaderResponse response) {
response.render(MetaDataHeaderItem.forMetaTag(Model.of("description"), () -> "Cool generated description"));
super.renderHead(response);
BasePage.html 相关头部部分
...
<title wicket:id="pageTitle"></title>
<wicket:header-items />
...
标记在<wicket:header-items /> 的位置呈现,但我仍然在<meta> 标记上方看到所有子javascript 标头。
实现这一点的检票口方式是什么?
【问题讨论】: