Purpose of Program
This intention of this program is to create and maintain a set of related websites with a common look and feel. Only the framework of the web pages are maintained, namely, the header, footer and the navigation menus. The contents of each page is copied from a master site.
The program may be used in the following ways:-
- Create a new website.
- Make a change to the common framework for all pages of a website.
- Add a new page or pages to a website.
- Move and/or delete pages from a website.
Intended Usage
A typical working set up consists of up to 4 directories, each placed in the root directory of the subject project. These are (using their conventional names):-
- website - Directory holding the resulting working website pages.
- webutil - Holds the layout.json file and various scripts (Windows batch files).
- web-new - Target directory when making changes to the layout.
- webmod - Alternative copy of the source website, where files can be moved and deleted.
The webutil/layout.json file is a full description of website in JSON format. A webutil/statistics.txt file is used, if you want to insert a statistics script into each page.
The following descriptions are based on a Windows operating system. The WebPageLayout program is named "wpl.exe" and is available on the system path. The batch files included with this project (or their Unix equivalent) should be available.
Creating a new website
Create the following files:-
- webutil/layout.json - A minimum layout file.
- webutil/statistics.txt - A script inserted into every page to aid web statistics (optional).
- website/sys/logo266x100.png - A 266 x 100 pixel logo displayed on all web pages' heading.
- website/sys/logo32x32.png - A 32 x 32 pixel logo used as a favicon.
- website/sys/bullet_hov.png - A 16 x 16 pixel bullet point hi-lighting the navigation button under the cursor.
- website/sys/bullet_cur.png - A 16 x 16 pixel bullet point for "current page" navigation button.
Run the webutil/make-from-website.bat batch file. This should produce a new web-new directory containing a functional, if content-less, website. One you are satisfied the new website is working how you want, delete (or rename) the website directory and rename the web-new to website.
Add content to the web pages by directly editing the website/*.htm files.
Only make changes between the lines marked
<div id='content'>
and
</div><!--id=content-->
Note, you will need to manually update git when creating or removing website files.
Change Framework or Create New Pages
Edit the webutil/layout.json file to to make changes to the framework and/or add pages. Run the webutil/make-from-website.bat batch file to create the web-new directory. As before, once satisfied all is OK, delete (or rename) the website directory and rename web-new to website.
Update the web pages content directly in the website directory.
Move and/or Delete Pages from a Website
Copy the website directory to webmod and use this to rearrange site by moving, adding and deleting files. The webutil/layout.json is edited (after making a backup) to reflect the new site. Run the webutil/make-from-webmod.bat batch file. Repeat the process until you are satisfied the site is as required.
Backup the website directory and then ensure the any deleted or moved files are updated with git. Rename web-new to website and again ensure git is maintained.
Update the web pages content directly in the website directory.