Skip to content

Commit

Permalink
Merge pull request #268 from inkss/xaoxuxu-pjax
Browse files Browse the repository at this point in the history
Pjax 部署推送
  • Loading branch information
xaoxuu authored May 3, 2020
2 parents 9ed958f + 399294a commit 8a6d23b
Show file tree
Hide file tree
Showing 14 changed files with 462 additions and 256 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ plugins:
# Optional
fixed: false # enable fixed mode
theme: '#1BCDFC' # main color
autoplay: false # audio autoplay
autoplay: true # audio autoplay
order: list # player play order, values: 'list', 'random'
loop: all # player loop play, values: 'all', 'one', 'none'
volume: 0.7 # default volume, notice that player will remember user setting, default volume will not work after user set volume themselves
Expand Down Expand Up @@ -573,4 +573,4 @@ info:
docs: https://volantis.js.org/ # This is theme's URL.
cdn:
# css: https://cdn.jsdelivr.net/gh/xaoxuu/[email protected]/css/style.css
# js: https://cdn.jsdelivr.net/gh/xaoxuu/[email protected]/js/app.js
# js: https://cdn.jsdelivr.net/gh/xaoxuu/[email protected]/js/app.js
1 change: 0 additions & 1 deletion layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@
<% }) %>
</footer>
<% } %>
<script>setLoadingBarProgress(80);</script>
15 changes: 8 additions & 7 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@
}
}
%>
<title><% if (title) { %><%= title %> - <% } %><%= config.title %></title>
<title><% if (title) { %><%= title %> - <% } %><%= config.title %></title>
<% if (keywords){ %>
<meta name="keywords" content="<%- keywords %>">
<% } else { %>
<meta name="keywords" content="<%- config.keywords || '' %>">
<% } %>
<% if (description){ %>
<meta name="description" content="<%- description %>">
<% } else { %>
<meta name="description" content="<%- config.description || '' %>">
<% } %>

<!-- feed -->
Expand All @@ -84,6 +88,7 @@

<!-- link -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/nprogress.css">
<% if (theme.plugins.fancybox && theme.plugins.fancybox.css) { %>
<%- css(theme.plugins.fancybox.css) %>
<% } %>
Expand All @@ -92,7 +97,7 @@
<% } %>

<% if (config.favicon) { %>
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<% } %>

<% if (theme.plugins.aplayer.enable) { %>
Expand All @@ -116,11 +121,7 @@
<%- css('css/style.css') %>
<% } %>

<script>
function setLoadingBarProgress(num) {
document.getElementById('loading-bar').style.width=num+"%";
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/nprogress.min.js"></script>

<% if (config.google_analytics_key) { %>
<!-- Global site tag (gtag.js) - Google Analytics -->
Expand Down
4 changes: 1 addition & 3 deletions layout/_partial/header.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="loading-bar-wrapper">
<div id="loading-bar"></div>
<script>NProgress.configure({parent:"#loading-bar-wrapper"});NProgress.start();</script>
</div>
<header class="l_header<%- page.sidebar == false ? ' no_sidebar' : '' %> <%- theme.style.navbar.effect.join(' ') %>">
<div class='container'>
Expand Down Expand Up @@ -119,5 +119,3 @@
</div>
</div>
</header>

<script>setLoadingBarProgress(40);</script>
38 changes: 38 additions & 0 deletions layout/_partial/pjaxData.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--此文件用来存放一些不方便取值的变量-->
<!--思路大概是将值藏到重加载的区域内-->

<%
var changeValinePath = 'none';
var changeValinePlaceholder = 'none';
var frontMatterCover = 'none';
var enableValine = false;
if (theme.comments && page && page.comments == true && theme.comments.valine && theme.comments.valine.appId) {
enableValine = true;
}
if (page && page.comments == true) {
if (enableValine && page.valine && page.valine.path) {
changeValinePath = page.valine.path;
}
if (enableValine && page.valine && page.valine.placeholder) {
changeValinePlaceholder = page.valine.placeholder;
}
}
if (page && page.cover) {
frontMatterCover = page.cover;
}
%>

<div id="pjax-data" style="display: none">

<div id="page-cover"><%=frontMatterCover%></div>

<% if (enableValine){ %>
<div id="valine-path"><%=changeValinePath%></div>
<div id="valine-placeholder"><%=changeValinePlaceholder%></div>
<% } %>
</div>

Loading

0 comments on commit 8a6d23b

Please sign in to comment.