Back to topic list

Content files

Content is stored in content files. Content files are in cms folder.

Linking content to template

Scoping is very simple. Every page(.hbs file) from pages folder has access to file with the same name in cms folder.

Global content

There is a cms/global subfolder. Every content file in this directory is accessible to all pages. Content from global folder is in global object when referencing from handlebars template.

Basic example

cms/index.js

{
    name: 'martin'
}

cms/global/car.js

{
    car: 'toyota'
}

pagez/index.hbs

<div class="user">{{name}}</div>
<div class="car">{{global.car}}</div>
Back to topic list

Shout out to pexels and freepik