Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for USE_CDN, momentjs and fancydates. Fixes #84 #85

Merged
merged 2 commits into from Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion v7/lanyon/README.md
Expand Up @@ -20,4 +20,3 @@ Known Issues:
* Not all features of Nikola are tested.
* Galleries will work better when [Issue #1764](https://github.com/getnikola/nikola/issues/1764) is fixed.
* Submenus in navigation links are not supported
* CDNs are not used regardless of ``USE_CDN``
2 changes: 2 additions & 0 deletions v7/lanyon/bundles
@@ -1 +1,3 @@
assets/css/all.css=rst.css,code.css,poole.css,lanyon.css
assets/js/all-nocdn.js=jquery.min.js,moment-with-locales.min.js,fancydates.js
assets/js/all.js=moment-with-locales.min.js,fancydates.js
6 changes: 6 additions & 0 deletions v7/lanyon/templates/base.tmpl
Expand Up @@ -47,6 +47,12 @@ ${template_hooks['extra_head']()}
${body_end}
${template_hooks['body_end']()}
${base.late_load_js()}
<!-- fancy dates -->
<script>
moment.locale("${momentjs_locales[lang]}");
fancydates(${date_fanciness}, ${js_date_format});
</script>
<!-- end fancy dates -->
<%block name="extra_js"></%block>
</body>
</html>
16 changes: 16 additions & 0 deletions v7/lanyon/templates/base_helper.tmpl
Expand Up @@ -61,6 +61,22 @@ lang="${lang}">
</%def>

<%def name="late_load_js()">
%if use_bundles:
%if use_cdn:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="/assets/js/all.js"></script>
%else:
<script src="/assets/js/all-nocdn.js"></script>
%endif
%else:
%if use_cdn:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
%else:
<script src="/assets/js/jquery.min.js"></script>
%endif
<script src="/assets/js/moment-with-locales.min.js"></script>
<script src="/assets/js/fancydates.js"></script>
%endif
${social_buttons_code}
</%def>

Expand Down