如何在 asciidoc 中指定原始 html 位置?

How to specify raw html place in asciidoc?

我正在尝试在 asciidoc 中使用原始 html。为此,我正在使用它;

+++<link rel="icon" type="image/png" href="@{/images/favicon.png}">+++

但是这个解决方案没有将 link 标签放在 head 标签中。如何指定将 link 标签放在 head 标签内?

在 Asciidoctor 生成的 HTML 页面的 <head> 中修改内容的正确方法是使用 docinfo 文件:

https://asciidoctor.org/docs/user-manual/#docinfo-file

例如,在您的 Asciidoc 文档中:

= My document title
:docinfo: shared

Lorem ipsum etc...

然后,在包含您的 Asciidoc 文件的同一文件夹中创建一个名为 docinfo.html 的文件,并定义您的 <link> 标签、其他 CSS 等。例如:

<link rel="icon" type="image/png" href="/images/favicon.png">

<style>
// styles...
</style>