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

artitalk 的 pjax 预兼容处理 #429

Merged
merged 1 commit into from
Aug 8, 2020
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
40 changes: 0 additions & 40 deletions layout/_partial/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,6 @@
</script>
<% } %>

<% if (theme.plugins.Artitalk && theme.plugins.Artitalk.enable && page.layout == "artitalk") { %>
<script>
var appID ="<%= theme.plugins.Artitalk.appID %>";
var appKEY ="<%= theme.plugins.Artitalk.appKEY %>";
<% if(theme.plugins.Artitalk.severurl){ %>
var severurl="<%= theme.plugins.Artitalk.severurl %>";
<% } %>
<% if(theme.plugins.Artitalk.slanguage){ %>
var slanguage="<%= theme.plugins.Artitalk.slanguage %>";
<% } %>
<% if(theme.plugins.Artitalk.per){ %>
var per="<%= theme.plugins.Artitalk.per %>";
<% } %>
<% if(theme.plugins.Artitalk.placeholder1){ %>
var placeholder1="<%= theme.plugins.Artitalk.placeholder1 %>";
<% } %>
<% if(theme.plugins.Artitalk.placeholder2){ %>
var placeholder2="<%= theme.plugins.Artitalk.placeholder2 %>";
<% } %>
<% if(theme.plugins.Artitalk.lazy==0){ %>
var lazy=0;
<% }else{ %>
var lazy=1;
<% } %>
<% if(theme.plugins.Artitalk.bgimg){ %>
var bgimg="<%= theme.plugins.Artitalk.bgimg %>";
<% } %>
<% if(theme.plugins.Artitalk.color1){ %>
var color1="<%= theme.plugins.Artitalk.color1 %>";
<% } %>
<% if(theme.plugins.Artitalk.color2){ %>
var color2="<%= theme.plugins.Artitalk.color2 %>";
<% } %>
<% if(theme.plugins.Artitalk.color3){ %>
var color3="<%= theme.plugins.Artitalk.color3 %>";
<% } %>
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/artitalk"></script>
<% } %>

<% if (theme.plugins.instant_page) { %>
<script async src="<%- theme.plugins.instant_page %>" type="module" defer integrity="sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1"></script>
<% } %>
Expand Down
39 changes: 39 additions & 0 deletions layout/artitalk.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,42 @@
<%- partial('_partial/article', {post: page, index: false}) %>
</div>
<%- partial('_partial/side') %>

<script>
if (window.AV != undefined) { delete window.AV;}
var appID ="<%= theme.plugins.Artitalk.appID %>";
var appKEY ="<%= theme.plugins.Artitalk.appKEY %>";
<% if(theme.plugins.Artitalk.severurl){ %>
var severurl="<%= theme.plugins.Artitalk.severurl %>";
<% } %>
<% if(theme.plugins.Artitalk.slanguage){ %>
var slanguage="<%= theme.plugins.Artitalk.slanguage %>";
<% } %>
<% if(theme.plugins.Artitalk.per){ %>
var per="<%= theme.plugins.Artitalk.per %>";
<% } %>
<% if(theme.plugins.Artitalk.placeholder1){ %>
var placeholder1="<%= theme.plugins.Artitalk.placeholder1 %>";
<% } %>
<% if(theme.plugins.Artitalk.placeholder2){ %>
var placeholder2="<%= theme.plugins.Artitalk.placeholder2 %>";
<% } %>
<% if(theme.plugins.Artitalk.lazy==0){ %>
var lazy=0;
<% }else{ %>
var lazy=1;
<% } %>
<% if(theme.plugins.Artitalk.bgimg){ %>
var bgimg="<%= theme.plugins.Artitalk.bgimg %>";
<% } %>
<% if(theme.plugins.Artitalk.color1){ %>
var color1="<%= theme.plugins.Artitalk.color1 %>";
<% } %>
<% if(theme.plugins.Artitalk.color2){ %>
var color2="<%= theme.plugins.Artitalk.color2 %>";
<% } %>
<% if(theme.plugins.Artitalk.color3){ %>
var color3="<%= theme.plugins.Artitalk.color3 %>";
<% } %>
</script>
<script async type="text/javascript" src="https://cdn.jsdelivr.net/npm/artitalk"></script>