Log in

HCMC Journal

Simple Site Build

: Illya Nokhrin
Minutes: 1200

After a fair bit of work with PS, we have come up with a simple site build process that seems to work farily well, though I am sure more tweaks will be needed. Right now, it is based around the site for the forthcoming Brecht conference. It will have to be abstracted out to create a base simple site repository later. I will probably do this once we have successfully completed the Brecht site, since hopefully at that point we will have ironed out most of the major issues. Figuring out how to best handle bilignual sites took quite a bit of time. Initially, I thought we could have a monolingual landing/splash page with bilingual content pages, but utlimately we decided on having bilingual pages throughout. We also decided to not simply have one page with all the content and relying on CSS to strip out all the content we did not want. Going the CSS-filtering route may have been simpler from a build perspective, but it would also have made it more difficult to link to content in a particular language (and ensure that content for each language is indexed correctly). It probably would also have created some build challenges at some point down the line, though it is difficult to predict what they would have been without trying it.

At the moment, the build process relies on the properties.xml file, which lists the languages used for the site and provides content for all the site chrome content that has to be different in each language. This includes image alt text, aria labels, nav toggle labels, and navigation menu items. In addition to the properties.xml file, the other files that PS (or someone else) will have to edit for each site will be the boilerplate files for the landing/splash page and for the content pages. These boilerplate files can have elements and attributes inserted/removed into them as needed for each site. Content will also obviously be different for each site and will have to be provided or transformed into XML and placed into the content direcotry. If the site is bilingual, the content has to be split into language-appropriate subdirectories (content/en and content/fr for example). The build process looks at how many languages are set out in the properties.xml file and runs the monolingual or bilingual build targets as appropriate. For bilingual builds, it uses the boilerplate files to generate new template files for each language with data included from the appropriate parts of the properties.xml file for each file. These bilingual template files are then used to process the XML files in the content directory into HTML5 pages. The build should theoretically work for tri- (or quadri- or penta-)lingual sites, though I have not tested this.

I have built in a few extra things into the build process. First, the root index HTML page serves as a redirect to the appropriate language based on the user’s browser settings. This always falls back to the default language as specified in the properties.xml file. Second, if we want to have the root index HTML page simply be a language selector page, we only need to uncomment the LanguageSelector section of the properties.xml file and fill in the appropriate values. I’ve made the language selector a simple select list for now. If we want to add the option of styling it, we may want to create a boilerplate template for it and process it using XSLT.