From 5ca8e50b016be720f769be6b06ec77d94023c4b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=A5gedal=20Reimer?= <skagedal@gmail.com>
Date: Mon, 23 Feb 2015 09:24:38 +0100
Subject: [PATCH] Make sure "Manual" module has access to "site"

A hack for bug #6167.
---
 _plugins/manual.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/_plugins/manual.rb b/_plugins/manual.rb
index 2a5d905..71a82b5 100644
--- a/_plugins/manual.rb
+++ b/_plugins/manual.rb
@@ -7,6 +7,10 @@ module Manual
 
   DIRECTORY_ENTRIES = {}
 
+  def self.setsite(s)
+    @@site = s
+  end
+
   def self.traverse_data(entries, directory_sort = false, paths = [], key_paths = [], &block)
 
     entries.map do |entry|
@@ -69,7 +73,7 @@ module Manual
     def self.extract_data(filename)
       if File.exists?(filename) and !File.directory?(filename) and first3 = File.open(filename) { |fd| fd.read(3) } and first3 == '---'
         blah = filename.sub(/^_manual\//,'')
-        page = Jekyll::Page.new(@site, '_manual', File.dirname(blah), File.basename(blah))
+        page = Jekyll::Page.new(@@site, '_manual', File.dirname(blah), File.basename(blah))
         page.data
       else
         {}
@@ -92,6 +96,8 @@ module Manual
 
       manual_dir = '_manual'
 
+      Manual.setsite(site)
+
       # now we need to turn our raw input files into something for jekyll to process
       # everything is in a directory with it's name and all content is in index.html files
       # the tmpdir gets removed at the end of this block automatically
-- 
2.1.0

