Skip to content

Multiple config files

Devin edited this page Sep 23, 2020 · 2 revisions

If you use Frontman to generate big websites, your config.rb file might get very long. To clean things up a bit, you can split your config.rb file into multiple files. For example, you could create a separate file where you define all your Frontman::Config variables, one where you add your pages to the sitemap, and so on.

Including another file in your config.rb

Frontman always requires the presence of a config.rb file, and takes this as the start of your Frontman site. From this file, you can include other files so that the logic is nicely separated.

For example, if you want to include the config/sitemap_setup.rb and config/configuration_setup.rb files, add the following code to your config.rb:

import_config 'config/sitemap_setup'
import_config 'config/configuration_setup'

Clone this wiki locally