Script-based Website Maintenance



File organisation

Careful organisation of your files will allow you to make changes easily to an individual page, a whole website, or even a collection of websites that you maintain.

General files

These files will provide commands, functions and scripts extending the basic capabilities of your scripting tools, or producing HTML/XML/CSS in general. You may also include information about yourself, e.g. if you want your email address to appear on each page.

When you change these files, you are changing all your websites.

We will assume that you have created these directories:

include/

Holds files to be included by m4, and make. You should set at least set your environment variable MAKEFLAGS to include from this directory. You should also do the same with M4PATH, or run m4 with -Iinclude from a makefile.

For example, you could create the following files:

ext.m4

to hold general macros that extend m4.

ctxt.m4

to hold context-defining and context-sensitive macros, such as INLANG and LANG.

xml.m4

to hold macros that process content but not mark-up, e.g. Qx, gx.

html.m4

to hold macros that work in HTML but not XHTML, e.g. PAGE, ELEMEND.

xhtml.m4

to hold macros that work in XHTML but not HTML, e.g. PAGE, ELEMEND.

html-common.m4

to hold macros that work in both HTML and XHTML (Include this from the above two files.);

svg.m4

to hold macros that work in SVG.

css.m4

to hold macros that work in CSS.

uris.mk

to hold macros which manipulate URIs and hierarchical filenames .

webscripts.mk

to hold the generic assembly rules.

etc/

Holds scripts for sed and awk.

bin/

Holds executable shell scripts.

Site-specific files

Create a directory to hold the source files and configuration of your website, say, mywebsrc, and within it, these directories and files:

etc/

Holds site-wide definitions. Create in here these files:

site.m4

Holds general m4 definitions, e.g.:

include(`uris.m4')dnl
include(`resources.m4')dnl
include(`ext.m4')dnl
include(`ctxt.m4')dnl
include(`commands.m4')dnl
site.xml.m4

Holds m4 definitions for XML/(X)HTML/SVG.

site.html.m4

Holds m4 definitions for just HTML.

site.xhtml.m4

Holds m4 definitions for just XHTML.

site.html-common.m4

Holds m4 definitions for (X)HTML.

site.svg.m4

Holds m4 definitions for just SVG.

site.css.m4

Holds m4 definitions for CSS.

src/tables/

Holds simple look-up tables.

src/scripts/

Holds the scripts for processing the look-up tables.

Makefile

Works out how to build the final HTML/XML/CSS files.

When you change these files, you are changing all of one website.

Page-specific files

Create a directory to shadow the directory and files you're going to create and publish:

src/www/

Holds the primary source files (one per public file).

The contained files should have a .m4 suffix to enable your text editor to use the correct mode automatically. They should also have:

For example, index.fr.html.m4, in that order.



Updated: 2007-May-11 16:56 GMT
Contact Steven Simpson

Ĉi tiu paĝo disponeblas ĉi-lingve, laŭ via krozila agordo.