aboutsummaryrefslogtreecommitdiff
path: root/docs/_plugins
diff options
context:
space:
mode:
authorDavid\ Beitey <[email protected]>2015-09-08 14:36:00 +1000
committerDavid\ Beitey <[email protected]>2015-09-08 14:36:00 +1000
commit7a2fa5e60a2e0c6a493a7e7c427ebeb3355f8f16 (patch)
treef383b53fe3697ddfd0f5cd18dab24655e5eb38d7 /docs/_plugins
parent2dce4740cf05229459e2a1d448f6364f3522e83c (diff)
downloadbootstrap-7a2fa5e60a2e0c6a493a7e7c427ebeb3355f8f16.tar.xz
bootstrap-7a2fa5e60a2e0c6a493a7e7c427ebeb3355f8f16.zip
Specify configBridge as relative path to source
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.
Diffstat (limited to 'docs/_plugins')
-rw-r--r--docs/_plugins/bridge.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/_plugins/bridge.rb b/docs/_plugins/bridge.rb
index 450a6cce3..a5d30a8f4 100644
--- a/docs/_plugins/bridge.rb
+++ b/docs/_plugins/bridge.rb
@@ -3,7 +3,8 @@ require 'yaml'
module Bridge
class Generator < Jekyll::Generator
def generate(site)
- site.data["configBridge"] = YAML.load_file("./grunt/configBridge.json")
+ path = File.join(site.source, "../grunt/configBridge.json")
+ site.data["configBridge"] = YAML.load_file(path)
end
end
end \ No newline at end of file