Variables in an After Publish batch file - On Premises 7

Variables

In some cases you may want to use your after publish batch file to assign a value to a variable in an external file. For example, changing the filename of a published HTML page from index.htm to index_Productname.htm so that the product name for the manual is added to the filename.

This uses a similar method to resolving variables in external files. Additional steps include:

To resolve a variable from a batch file:

  1. Include the variable as part of the code in the batch file. The variable must be defined using a namespace declaration, where the text "authorit:" is prefixed to the variable itself. For example:

    <authorit:variablename> where variablename is the variable to substitute.

  2. Add the .bat file extension to the variable substitution list. Open the library in Administrator, choose Variables > HTML Variable Substitution... then add the file format .bat; to the list.

    HTML substitution dialog box

  3. Assign the variable value to the book.
  4. Publish the book to HTML.