From 992998681e03977536cdce17c23dbaaf1e92404a Mon Sep 17 00:00:00 2001 From: Spocke Date: Thu, 10 Nov 2016 11:45:16 +0100 Subject: [PATCH] fixed multiple body include bug --- _layouts/default.html | 8 ++++---- _plugins/include_remote.rb | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 00683f8..6155971 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -18,13 +18,13 @@ - {% include_remote {{ site.origin }}/_docs/favicons.html %} + {% include_remote {{ site.origin }}/_docs/favicons.html css="head > *" %} {% if page.url contains '/demo/' %} - {% include_remote {{ site.origin }}/_docs/menu_demo.html %} + {% include_remote {{ site.origin }}/_docs/menu_demo.html css="body > *" %} {% else %} - {% include_remote {{ site.origin }}/_docs/menu.html %} + {% include_remote {{ site.origin }}/_docs/menu.html css="body > *" %} {% endif %}
@@ -82,7 +82,7 @@
- {% include_remote {{ site.origin }}/_docs/footer.html %} + {% include_remote {{ site.origin }}/_docs/footer.html css="body > *" %} diff --git a/_plugins/include_remote.rb b/_plugins/include_remote.rb index 57e536c..c9a996f 100644 --- a/_plugins/include_remote.rb +++ b/_plugins/include_remote.rb @@ -41,6 +41,10 @@ eos xpath = @params['xpath'] css = @params['css'] + # force params to strings + xpath = xpath.to_s if xpath + css = css.to_s if css + if ! html = @@remote_cache["#{@url}_#{xpath}_#{css}"] # fetch remote file page = Nokogiri::HTML(open(@url))