Template files for results, splits, runner ticket, etc. can be modified with any text editor for customization. By default, templates produce html files, but any text format (csv, json, xml…) can be generated by Geco and the mustache rendering engine.
Four types of result templates are used by Geco:
You can change texts, inserts logos, add or delete some data fields. Geco automatically fills in data fields, marked by double braces {{
and }}
.
You can modify, create, reuse those templates in many stages, share them with other people… You will probably find yourself reusing a few templates over and over in multiple stages. It is possible to further customize such templates (with sponsor logos, specific news) without making a copy for each stage. You can create your own data fields in a file named formats.prop
for each stage directory. Geco reads this file each time and injects custom data into your template.
results.mustache
(common file, reusable)
See you on {{NextStage}}
formats.prop
(in stage directory)
NextStage=May 23 at the Castle
The results.mustache
file can then be reused in many stages without change. Just copying and adapting the formats.prop
file would be enough.
Please note that Geco uses geco_
ou i18n_
prefixes for its own data fields. Don’t use such prefixes, they are here to avoid name collisions with your own fields.
Templates contain mustache data fields as marked by double braces {{
and }}
. Geco detects and replaces those fields when generating results file using the required data: stage name, runner name, time, control code, status…
Mustache provides three kinds of field:
{{geco_RunnerName}}
is a basic data field: it will be replaced by the runner name in the generated file.{{#geco_RunnersCollection}}...{{/geco_RunnersCollection}}
represents an iterative section which stands for a collection of runners: section content will be generated once for each runner.{{#geco_BestTime?}}...{{/geco_BestTime?}}
represents an optional section: content will appear only if the value geco_BestTime?
is true - thus some data can appear or not depending on configuration variables (by convention, such fields are suffixed by ?
).Some sections only exist nested inside other sections. For example, at top level you can find results by course, then for each course you will find runners, then for each runner you will find split times.
General information (top level):
The top level context also contains the #geco_ResultsCollection
field, which lists all results ordered by group (courses or categories). Group data fields are described below.
For each course/category in the results:
#geco_SingleCourse?
is true#geco_SingleCourse?
is trueFor each runner (ranked or not):
Same fields as above. More data fields are included per each runner:
The data fields for the runner are available (except rank and diff time), as well as split times in rows and columns (as above) and some data about the stage.
Data fields for the runner and stage are available. Split times come in one collection described below.
time
, miss
, add
)