如何在 asciidoctor 模板中渲染 asciidoc 文件名?

How to render asciidoc filename in asciidoctor template?

我有一个类似于这个的 asciidoctor 模板:

https://github.com/asciidoctor/asciidoctor-backends/blob/asciidoctor-v0.1.4/erb/html5/document.html.erb

我想在我的文档中包含一个 link,它指向用于生成文档的 asciidoc 文件。

有没有办法在我的模板中访问 asciidoc 文件名?

我正在使用 asciidoctor-maven-plugin 呈现我的文档。

通过查看 built-in data attributes,我认为您正在寻找 {docfile}(评估取决于文档的处理方式以及处理时间和地点)。

对我来说,它可以与 asciidoctor-maven-plugin 一起使用(我得到了文件的绝对路径)但在 chrome 预览中没有。