Introduction
All html files should have their content written in a <div id='content'> block. The block tag may also include a class='nomenu' attribute (after the id attribute). All the markup outside of this block is the responsibility of the wpl program. It is created by reading in the layout file.
It is important to keep the actual files (which hold the content) in step with the layout file. If the layout file includes an entry for a missing page then one will be created. But if a page exists that is not in the layout file, it will not be removed or linked to.
The layout file is a standard JSON formatted file containing a Project Object. The current convention is to name the file layout.json and place it in the webutil directory.
When running the wpl program, the layout file must be named on the command line with the --layout switch.
JSON File Attributes
A website consists of html pages. These pages can be one of two types: a start-of-section page and a content page.
The start-of-section page normally contains a menu linking all the content pages. If the section is particularly large or complicated it is possible create the links to within the page text and suppress the built-in menu.
The contents of a section consist of a start-of-section page and of zero or more content pages or other start-of-section pages.
Project Object
The file contains the following Project Object. Unless otherwise stated, the elements types are strings.
- "project":
- Name of the project. It appears at the beginning of each page title.
- "home-url":
- An absolute URL to the projects home webpage. It is used to create a link when the title icon is clicked.
- "color-top":
- Colour of the title bar background.
- "color-border":
- Colour of the dark border accents.
- "logo-shadow": Boolean
- If true (the default) put a shadow under the main title logo. If not required, set to false.
- "site-css":
- If used, a css file of this name is added to every page.
- "sourceforge-url":
- If included, add a link option on every section menu.
- "github-url":
- If included, add a link option on every section menu.
- "download-url":
- If included, add a link option on every section menu.
- "stats-text":
- If included, points to a text file whose contents is included at the bottom of each page.
- "site": Page Object
- Description of the home page. Note this also contains the contents of the complete website tree.
Page Object
The Page Object describes a page. If the page is the start of a new section then it may also contain an array of additional pages in that section. The Page Object has the following properties:-
- "folder":
- Used in the first of page of a section. The directory this and the sections pages are placed.
- "name":
- The file name of the page, without the extension (.htm). If not given and is the start of a section, the name "index" is used. If not given otherwise, the object will be added to the section's menu but a page is not created.
- "label":
- The label used on the menu and breadcrumbs. Use "name" value if not given.
- "title":
- The page title which follows the project name. Same as the previous page if not given.
- "subtitle":
- The second line in the title block.
- "menu": Boolean
- If start of section and true (the default), add the section menu to the page.
- "map-label": Boolean
- If true (the default) use the "label" string as the page description in the site map. Otherwise, use the subtitle string.
- "css":
- If used, the file name of css file to be used for this page only.
- "content": Array of Page Objects
- A list of other pages in the section.