You can create static pages to be displayed in your EPUB file like titlepages at the beginning of your EPUB file or legal notices.

Before you begin: To create static pages, a template must exist and you must log in with Confluence Admin permissions.

Create your Static Page

First you have to create a new HTML file with the wanted content for your static page.

  1. Create a new HTML file in your EPUB template.
  2. Define a title and insert the content of your static page.
  3. Save the HTML file, for example 'titlepage.html'.

Link to the Static Page in the resources.opf.vm

The new HTML file needs to be linked in your template.

  1. Open the file resources.opf.vm with a texteditor.
  2. Scroll down to the <manifest>-tag and link to the HTML file by copying an existing <item>-tag and customize it. For example:

    <item id="titlepage" href="titlepage.html" media-type="application/xhtml+xml"/>
    CODE


    (info) The manifest-tag defines which files should be included in the exported EPUB-file.

  3. Scroll down to the <spine>-tag and insert the itemref to the spine at the wanted position. For example:

     <spine toc="ncx">
            <itemref idref="titlepage"/>              <!-- Add this line -->
            #macro(epubItemref $source)
                #if($source.Children.size() == 0)
                    <itemref idref="_$source.id"/>
                #else
                    <itemref idref="_$source.id"/>
                    #foreach($child in $source.children)
                        #epubItemref($child)
                    #end
                #end
            #end
            <itemref idref="_$context.sourceTree.id"/>
            #foreach($child in $context.sourceTree.children)
                #epubItemref($child)
            #end
        </spine>
    CODE

    (info) The spine defines the sequence of the HTML files inside the exported EPUB-file. The epubItemref macro is used to generate <itemref>-tags for the exported Confluence pages.

Link to the Static Page in the atlassian-plugin.xml

Finally you have to link the static page in the XML-file. This ensures that the Scroll EPUB exporter copies your HTML file from the template into the EPUB file.

  1. Open the file atlassian-plugin.xml with a texteditor.
  2. Scroll down to the <resource>-tags and link to the static page. For example:

    <resource type="static-resource" name="titlepage.html" location="template/titlepage.html" />
    CODE
  3. Save the file and upload your template as jar-file.

When you use the template, the static page is inserted at the defined position with the wanted content.