TTWeb Templates Introduction

Template Structure

A TTWeb template is a subset of files that you’d find in a typical jekyll project. They generally provide a set of model definitions, layouts, and includes. They may also include some pre-compiled stylesheets and javascript, in which case a head include or default layout file generally includes the apropriate <script> or <link> tag to pull in those files.

Usage

A site that uses these templates will generally have them installed via git submodules and will need to have it’s _config.yml set up to point to the template-provided content. For example, the bedrock template will generally be installed as a submodule under _ttio_templates/bedrock and a site using the template, would have the following in the config file. (Note that “includes” is the reverse lookup order from the others)

layouts_dir:
  - _ttio_templates/bedrock/_layouts
  - _layouts
data_dir: 
  - _ttio_templates/bedrock/_data
  - _data
includes_dir:
  - _includes
  - _ttio_templates/bedrock/_includes
i18n_dir:
  - _ttio_templates/bedrock/_locales
  - _locales

This allows jekyll to look for layouts, data, includes and locale content in the bedrock locations first and then override them with any matching content in the usual jekyll directores.

If a particular site wants to use most of jekyll but change the main nav layout only, they would just create the file _includes/nav-main.html and jekyll will use that file wherever {% include nav-main.html %} is specified instead of the file at _ttio_templates/bedrock/_includes/nav-main.html