From 0aff03f8dae210d5ea850c0877f85463d8f794c7 Mon Sep 17 00:00:00 2001 From: Robert Lord Date: Wed, 11 Jun 2014 21:58:33 -0700 Subject: [PATCH 01/36] Fixes #77, update sites without search Sites without search now do not include search.js or lunr.js, making the javascript for those pages much faster to load. --- source/javascripts/all_nosearch.js | 4 ++++ source/layouts/layout.erb | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 source/javascripts/all_nosearch.js diff --git a/source/javascripts/all_nosearch.js b/source/javascripts/all_nosearch.js new file mode 100644 index 00000000000..4610cabe62d --- /dev/null +++ b/source/javascripts/all_nosearch.js @@ -0,0 +1,4 @@ +//= require_tree ./lib +//= require_tree ./app +//= stub ./app/search.js +//= stub ./lib/lunr.js diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index 1ea9cf1a187..c206e1bd9e3 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -24,7 +24,11 @@ under the License. <%= stylesheet_link_tag :screen, media: :screen %> <%= stylesheet_link_tag :print, media: :print %> - <%= javascript_include_tag "all" %> + <% if current_page.data.search %> + <%= javascript_include_tag "all" %> + <% else %> + <%= javascript_include_tag "all_nosearch" %> + <% end %> <% if language_tabs %>