Proper Way

by Tom Swan

This page shows the correct way to attach a favicon image to an Asciidoctor-generated HTML document. Follow these steps:

  1. Create a docinfo.html file with the following text

    <!-- docinfo.html -->
    <link rel="icon"
  2. Set docinfo to shared at the top of your document’s text (see this page’s source text proper-way.txt, line 5, for an example).

  3. If you want all documents in the current folder to share the same favicon, move line 5 from proper-way.txt into config.adoc.

See the full article for more information about using docinfo. What it does for us here is inject the <link> tag into the <head> of the HTML file where it belongs.

You can find more information about docinfo header and footer files at this Asciidoctor User Manual Link.