Maven APT 页面中的占位符替换
我正在处理一些相关项目的 Maven 站点文档,并且我想创建从一个站点文档到另一个站点文档的超链接。问题是链接目标的 URL 取决于 Maven 属性。
我尝试了这个:
{{{http://example.com/site/project-${some-prop}/some.html}the documentation}}
但是 ${some-prop} 占位符没有被替换,然后 APT 处理器被替换 被第一个“}”搞糊涂了。转义 { 和 } 字符(例如 $\{some-prop\}
)没有帮助,并且以下内容也不起作用:
{{http://example.com/site/project-${some-prop}/some.html}}
是否有其他方法可以完成此任务?例如,是否有一种方法可以定义一个 Doxia 宏来替换扩展了占位符的 URL?
I am working on Maven site documentation for some related projects, and I want to create a hyperlink from one site's documentation to another sites documentation. The wrinkle is that the URL for the link target depends on a Maven property.
I tried this:
{{{http://example.com/site/project-${some-prop}/some.html}the documentation}}
but the ${some-prop} placeholder doesn't get replaced, and the APT processor then gets
confused by the first '}'. Escaping the { and } characters (e.g. $\{some-prop\}
) doesn't help, and the following doesn't work either:
{{http://example.com/site/project-${some-prop}/some.html}}
Is there some other way that I can accomplish this task? For example, is there a way to define a Doxia macro that could be used to substitute a URL that had the placeholder expanded?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的是 2.0-beta-6 或更高版本的网站插件吗?另外,您的 apt 文件名是否以 .vm 扩展名结尾(如 创建内容?
Are you using version 2.0-beta-6 or later of the site plugin? Also, does your apt filename ends with a .vm extension (as described in the filtering section of Creating Content?