Developer Docs

index.html Template

The index.html file is the main Template for a Theme
The index.html file contained in the theme folder is the framework for all your other pages to be generated from.


A themes index.html file follows a familiar structure that is common in nearly all modern web pages. This section aims to familiarise you with the template document.
The basic layout of the theme index.html should look familiar to you:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://”>
<html xmlns=””>
<title>This is the Page Title</title>
<link href=”styles.css” rel=”stylesheet” type=”text/css”
media=”screen” />
<div id=”container”>
<div id=”pageHeader”>
<div id=”contentContainer”>
<div id=”content”>
<div id=”sidebarContainer”>
<div id=”navcontainer”>
<div id=”sidebar”>
<div id=”footer”>Footer</div>


RapidWeaver will automatically set the language of the template index.html file based on the user's preference.
Your Template file should not include the lang attribute.
<html lang="en">
Instead, it should just include the opening HTML tag, like this:

Syntax Tags

The Syntax Tags found in the template file will be replaced with actual content when the page is published of exported by RapidWeaver.
The main content areas are distinguished by elements, each open and close tag contains a Syntax Tag. For example.
<div id=”content”>%content%</div>
The majority of the syntax tags relate directly back to a text area in RapidWeaver, it should be obvious which tag corresponds to which area.
The tags can be placed anywhere within the template. To recap a RapidWeaver Syntax Tag looks like this:
This is the tag for the main content of the page anything in the main window in RapidWeaver will be inserted here.
This tag refers to the Sidebar Window in the Page Inspector, again any text or images entered into the Sidebar in RapidWeaver will be converted to HTML and will replace this tag in the .html file. A full list of tags can be found in the file Theme Syntax section.

The %pathto(...)% Tag

All RapidWeaver Syntax Tags, with one exception, look exactly the same. The exception is the %pathto(file.extension)% tag. This tag is used for site consolidation, essentially meaning that RapidWeaver will automatically generate links to files located in the theme folder.
When exporting a site RapidWeaver places all of the theme files in a folder called rw_common and generates the links to the files in this folder. This should be used when linking to any file in your theme file including stylesheets, javascript files and images.


Linking to the styles.css file in your theme directory.
the published code will look something like this:
Folders can be included before the image name:
The published code will look something like this:
All tags can also be used inside styled text areas in RapidWeaver. The %pathto(...)% tag is particularly useful should you want to include images or links to files inside your theme.