Front Cover Image
When using a title page, you might want to set a front cover image. To do that, you will need to add a few lines of CSS.
Here’s a complete example:
-
Create a file named orly.adoc with the following content:
= Hoping This Works :doctype: book == Guessing The first step is guessing.We are using
:doctype: bookto get a title page. -
Create a file named orly.css with the following content:
@page :first { background-size: contain; background-image: url("./orly.jpg"); } /* move the book title to the correct location */ #cover > h1 { color: white; margin-top: 8cm; font-size: 7rem; } -
Download the image orly.jpg and put it next to the orly.adoc file.
-
Open a terminal and type:
asciidoctor-web-pdf orly.adoc -a stylesheet="+orly.css"
The above command will create a file named orly.pdf which should look like: