Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implemented use_cdn + use_bundles
  • Loading branch information
ralsina committed May 5, 2015
1 parent 6df5331 commit f99aebd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nikola/data/themes/bootstrap3/templates/base_helper.tmpl
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions nikola/plugins/task/bundles.py
Expand Up @@ -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)
Expand Down

0 comments on commit f99aebd

Please sign in to comment.