diff --git a/config.rb b/config.rb index dfc8fa9..7c78d1e 100644 --- a/config.rb +++ b/config.rb @@ -1,29 +1,5 @@ -helpers do - def js_as_plain(id) - f = open("docs/js/samples/" + id + ".js") - js = f.read - f.close - js - end - def data_as_plain(name) - f = open("docs/data/" + name) - data = f.read - f.close - data - end - def css_as_plain(name) - f = open("docs/css/samples/" + name) - css = f.read - f.close - css - end - def get_css_name(path) - path.gsub('.html', '') - end -end - set :source, 'docs' -set :haml, { :ugly => true, :format => :html5 } +set :haml, { :format => :html5 } set :css_dir, 'css' set :js_dir, 'js' set :images_dir, 'img' diff --git a/docs/_sample.haml b/docs/_sample.haml index 9a87069..b7d47e0 100644 --- a/docs/_sample.haml +++ b/docs/_sample.haml @@ -10,14 +10,14 @@ .sourcecode.margin-medium-v.margin-small-h %h3 # #{id}.js #javascript-editor.c3-editor - = js_as_plain id + = File.read "docs/js/samples/#{id}" - if defined? other_css .sourcecode %h3 # #{other_css} %pre %code.css - = css_as_plain other_css + = File.read "docs/css/samples/#{other_css}" - if defined? other_files - other_files.each do |f| @@ -25,7 +25,7 @@ %h3 # #{f} %pre %code.html - = data_as_plain f + = File.read "docs/data/#{f}" = partial :footer diff --git a/docs/layouts/layout.haml b/docs/layouts/layout.haml index 5fcecc9..11b6038 100644 --- a/docs/layouts/layout.haml +++ b/docs/layouts/layout.haml @@ -16,7 +16,7 @@ = stylesheet_link_tag 'tomorrow' = stylesheet_link_tag 'c3' = stylesheet_link_tag 'style' - = stylesheet_link_tag get_css_name(current_page.path) + = stylesheet_link_tag current_page.path.gsub('.html', '') :javascript (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){