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

feat(materialcdn): bring materialcdn up. #252

Merged
merged 5 commits into from
Mar 28, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _config.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ topPost: false
# Integrated Services
# ---------------------------------------------------------------

# MaterialCDN
# When you set 'use' as true, the needed css, js, font file will have a new src.
# The new src will have the base domain you configured in 'base'.

materialcdn:
use:
base:

# Comment Systems
# Available value of "use":
# duoshuo | disqus | disqus_click
Expand Down
21 changes: 14 additions & 7 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,20 @@
<% } %>
<![endif]-->

<!-- Import CSS -->
<%- css('css/material.min') %>
<%- css('css/style.min') %>
<%- partial('_partial/config_css') %>

<%- js('js/jquery.min') %>
<%- js('js/queue') %>
<!-- Import CSS & jQuery -->
<% if(theme.materialcdn.use === true) { %>
<link rel="stylesheet" href="<%= theme.materialcdn.base %>/css/material.min.css">
<link rel="stylesheet" href="<%= theme.materialcdn.base %>/css/style.min.css">
<%- partial('_partial/config_css') %>
<script src="<%= theme.materialcdn.base %>/js/jquery.min.js"></script>
<script src="<%= theme.materialcdn.base %>/js/queue.js"></script>
<%}else{%>
<%- css('css/material.min') %>
<%- css('css/style.min') %>
<%- partial('_partial/config_css') %>
<%- js('js/jquery.min') %>
<%- js('js/queue') %>
<%}%>

<!-- UC Browser Compatible -->
<script>
Expand Down
16 changes: 13 additions & 3 deletions layout/_partial/import_js.ejs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<!-- Import File -->
<%- js('js/lazyload.min') %>
<%- js('js/js.min') %>
<% if(theme.materialcdn.use === true) { %>
<script src="<%= theme.materialcdn.base %>/js/lazyload.min.js"></script>
<script src="<%= theme.materialcdn.base %>/js/js.min.js"></script>
<%}else{%>
<%- js('js/lazyload.min') %>
<%- js('js/js.min') %>
<%}%>

<%- partial('_widget/nprogress') %>

<% if( theme.js_effect.smoothscroll === true ) { %>
<%- js('js/smoothscroll') %>
<% if(theme.materialcdn.use === true) { %>
<script src="<%= theme.materialcdn.base %>/js/smoothscroll.js"></script>
<%}else{%>
<%- js('js/smoothscroll') %>
<%}%>
<% } %>

<%- partial('_partial/footer-option') %>
Expand Down
6 changes: 5 additions & 1 deletion layout/_widget/nprogress.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<%- js('js/nprogress') %>
<% if(theme.materialcdn.use === true) { %>
<script src="<%= theme.materialcdn.base %>/js/nprogress.js"></script>
<%}else{%>
<%- js('js/nprogress') %>
<%}%>

<script type="text/javascript">
NProgress.configure({
Expand Down
19 changes: 14 additions & 5 deletions layout/_widget/page-gallery.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<%- css('css/gallery.min') %>

<% if(theme.materialcdn.use === true) { %>
<link rel="stylesheet" href="<%= theme.materialcdn.base %>/css/gallery.min.css">
<%}else{%>
<%- css('css/gallery.min') %>
<%}%>

<body>
<!-- Wrapper -->
Expand Down Expand Up @@ -85,9 +88,15 @@
</div>

<!-- Scripts -->
<%- js('js/jquery.min') %>
<%- js('js/gallery/gallery') %>
<%- js('js/lazyload.min') %>
<% if(theme.materialcdn.use === true) { %>
<script src="<%= theme.materialcdn.base %>/js/jquery.min.js"></script>
<script src="<%= theme.materialcdn.base %>/js/gallery/gallery.js"></script>
<script src="<%= theme.materialcdn.base %>/js/lazyload.min.js"></script>
<%}else{%>
<%- js('js/jquery.min') %>
<%- js('js/gallery/gallery') %>
<%- js('js/lazyload.min') %>
<%}%>

<script type="text/javascript">
queue.offer(function(){
Expand Down