You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
3 years ago
|
<% if (theme.verifyPassword.enable) { %>
|
||
|
<script src="<%- theme.jsDelivr.url %><%- url_for(theme.libs.js.crypto) %>"></script>
|
||
|
<script>
|
||
|
(function() {
|
||
|
let pwd = '<%- page.password %>';
|
||
|
if (pwd && pwd.length > 0) {
|
||
|
if (pwd !== CryptoJS.SHA256(prompt('<%- theme.verifyPassword.promptMessage %>')).toString(CryptoJS.enc.Hex)) {
|
||
|
alert('<%- theme.verifyPassword.errorMessage %>');
|
||
|
location.href = '<%- url_for("/") %>';
|
||
|
}
|
||
|
}
|
||
|
})();
|
||
|
</script>
|
||
|
<% } %>
|
||
|
|
||
|
<%- partial('_partial/post-cover') %>
|
||
|
|
||
|
<%
|
||
|
var isTocEnable = theme.toc.enable && String(page.toc) !== 'false';
|
||
|
var containerClass = isTocEnable ? 'post-container' : 'container';
|
||
|
%>
|
||
|
|
||
|
<main class="<%- containerClass %> content">
|
||
|
|
||
|
<% if (isTocEnable) { %>
|
||
|
<%- partial('_partial/post-detail-toc.ejs') %>
|
||
|
<% } else { %>
|
||
|
<%- partial('_partial/post-detail.ejs') %>
|
||
|
<% } %>
|
||
|
|
||
|
</main>
|
||
|
|
||
|
<% if (theme.mathjax.enable && page.mathjax) { %>
|
||
|
<script src="<%- theme.mathjax.cdn %>"></script>
|
||
|
<script>
|
||
|
MathJax.Hub.Config({
|
||
|
tex2jax: {inlineMath: [['$', '$'], ['\(', '\)']]}
|
||
|
});
|
||
|
</script>
|
||
|
<% } %>
|