Skip to main content

Pathing for referred data files and templates

Within a data file, you can refer to other data files and templates using absolute or relative paths. An absolute path is indicated by /, starting from the styleguide/ directory. A relative path is indicated by ./ or ../, starting from the directory in which the data file resides. (Do not include the styleguide/ directory in an absolute path.)

In the following illustration, the data files reference a template in a different directory.

showLineNumbers {7,9}
1
./
2
└── styleguide/
3
├── article/
4
│ ├── Article.hbs
5
│ └── Article.json
6
├── blogpost/
7
│ └── BlogPost.json (“_template”: ”/article/Article.hbs” 1
8
└── image/
9
└── Image.json (“_template”: ”../article/Article.hbs”
  • 7. References a file with an absolute path.
  • 9. References a file with a relative path.

Pathing behavior applies to both the root styleguide/ directory that contains the default theme (brightspot/express/styleguide/), as well as the child styleguide/ directories nested within the various themes’ directories, such as brightspot/express/themes/brightspot-theme-falcon/.

See also: