Permalink
Browse files

Implemented use_cdn + use_bundles

  • Loading branch information...
1 parent 6df5331 commit f99aebd4db29b1c5dc66728b474bc40c0e1c02ec @ralsina ralsina committed May 5, 2015
Showing with 10 additions and 4 deletions.
  1. +8 −4 nikola/data/themes/bootstrap3/templates/base_helper.tmpl
  2. +2 −0 nikola/plugins/task/bundles.py
@@ -68,12 +68,14 @@ lang="${lang}">
<%def name="late_load_js()">
%if use_bundles:
%if use_cdn:
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
+ % for url in cdn_js_urls:
+ <script src="${url}"></script>
+ % endfor
%endif
<script src="/assets/js/all.js"></script>
%else:
%if use_cdn:
+ FOO
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
%else:
@@ -94,12 +96,14 @@ lang="${lang}">
<%def name="html_stylesheets()">
%if use_bundles:
%if use_cdn:
- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
+ % for url in cdn_css_urls:
+ <link href="${url}" rel="stylesheet">
+ % endfor
%endif
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
%else:
%if use_cdn:
- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
+- <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
%else:
<link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
%endif
@@ -132,6 +132,8 @@ def build_bundle(output, inputs):
t_files.append(i)
_files = t_files
+ self.site.GLOBAL_CONTEXT['cdn_js_urls'] = self.cdn_js_urls
+ self.site.GLOBAL_CONTEXT['cdn_css_urls'] = self.cdn_css_urls
output_path = os.path.join(kw['output_folder'], name)
dname = os.path.dirname(name)

0 comments on commit f99aebd

Please sign in to comment.