Template resources

The resources section of the descriptor file specifies a set of resources (CSS, JS, fonts, logos, etc.) that are used to customize various components in generated output. These resources will be copied to the output folder during the transformation process. At least one CSS file must be included, while the other types of resources are optional.

The types of resources that can be specified include:
  • CSS files - One or more CSS files that will define the styles of all generated HTML pages.
  • Favicon - You can specify the path to an image for the favicon associated with your website.
  • Logo - You can specify the path to a logo image that will be displayed in the left side of the output header. Optionally, you can also specify:
    • target-url - will redirect the user to the specified URL if they click the logo in the output.
    • alt - provides an alternate text for the logo image.
  • JavaScript AMD module - The path to a JavaScript module that uses the AMD (Asynchronous Module Definition) format. This module will be loaded in the output HTML pages using the RequireJS library.
  • Additional Resources (JS, Fonts) - You can specify one or more sets of additional resources that will be copied to the output folder during the transformation process. These resources are specified with the fileset element and you can use one or more include and exclude elements. This semantic is similar to the ANT FileSet.
<publishing-template>
    ...
    <webhelp>
      ...                
      <resources>            
          <css file="css/custom_styles.css"/>
          <css file="css/custom_fonts.css"/>
		 		
          <favicon file="images/favicon.png"/>
				
          <logo 
           file="images/logo.png" 
           target-url="http://www.example.com"
           alt="Alternate text for the logo image"/>
				
          <js-amd-module file="js/template-main.js"/>
				
          <fileset>
              <include name="common/**/*"/>
              <include name="JS/**/*"/>              
              <exclude name="**/*.svn"/>
              <exclude name="**/*.git"/>
          </fileset>
      </resources>
Note: All relative paths specified in the descriptor file are relative to the template root folder.

The resources specified in the template descriptor are copied to the following output folder: [WebHelp OUTPUT DIR]/oxygen-webhelp/template. The following graphic illustrates the mapping between the template resources and the location where they will be copied to the output folder:

Figure: Template Resources Mapping