using the context

The context comes from two different places:

  1. The default context .context which is available to all of the files
  2. The individual context <filename%gt;.context which is only available to the filename file

The default context

For all files that are generated, there is a .context file that resides in the <input_directory> directory, each of the properties are placed in every context and made available to all files. For this generation, the input file is src/.context.

The default context file (src/.context) is below:

head-title=templar gen by synapticloop

header-h1=templar-gen
header-h2=Welcome to templar gen
header-tagline=Generate static pages using the templar templating language

sidebar-h3=templar-gen
sidebar-tagline=Generate static pages using the templar templating language

github-org=synapticloop
github-repo=templar-gen

Which can then be referenced in any file:

  • {head-title} outputs: templar gen by synapticloop
  • {header-h1} outputs: templar-gen
  • {sidebar-h3} outputs: templar-gen
  • {sidebar-tagline} outputs: Generate static pages using the templar templating language

The individual context

For each file that is generated, where there is a corresponding .context file, each of the properties are placed in the context and made available to that file only.

contextItemOne=hello

contextItemTwo=This is an individual context item which is only available to the \
'using-the-context.html' file

Which can then be referenced in this file only:

  • {contextItemOne} outputs: hello
  • {contextItemTwo} outputs: This is an individual context item which is only available to the 'using-the-context.html' file