mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00

This adjusts the load path for the ``configBridge.json`` file from one that's relative to the user running the command (eg ``jekyll serve``), to one that's relative to the ``source`` configuration setting for Jekyll. The result is that the user can now have a (customised) ``_config.yml`` for Jekyll anywhere on her filesystem and point to Bootstrap's ``docs`` directory to use as the ``source``. Previously, in order to customise it, the original ``_config.yml`` needed to be modified inside (a forked) Bootstrap, and the ``jekyll`` command could only be run at the root of the Bootstrap package as the original file path to ``configBridge.json`` was only valid there. The existing behaviour is not affected.
10 lines
No EOL
229 B
Ruby
10 lines
No EOL
229 B
Ruby
require 'yaml'
|
|
|
|
module Bridge
|
|
class Generator < Jekyll::Generator
|
|
def generate(site)
|
|
path = File.join(site.source, "../grunt/configBridge.json")
|
|
site.data["configBridge"] = YAML.load_file(path)
|
|
end
|
|
end
|
|
end |