优化heti配置
This commit is contained in:
parent
724d23ca5c
commit
65ce616542
|
@ -40,7 +40,11 @@ function div_default() {
|
|||
el += '</h2>';
|
||||
|
||||
// 摘要
|
||||
el += '<div class="excerpt heti">';
|
||||
el += '<div class="excerpt';
|
||||
if (theme.plugins.heti && theme.plugins.heti.enable) {
|
||||
el += ' heti';
|
||||
}
|
||||
el += '">';
|
||||
el += '<p>';
|
||||
if (post.excerpt) {
|
||||
el += strip_html(post.excerpt);
|
||||
|
|
|
@ -124,6 +124,9 @@
|
|||
if ('<%- theme.plugins.fancybox.enable %>' == 'true') {
|
||||
stellar.plugins.fancybox = Object.assign(<%- JSON.stringify(theme.plugins.fancybox) %>);
|
||||
}
|
||||
if ('<%- theme.plugins.heti.enable %>' == 'true') {
|
||||
stellar.plugins.heti = Object.assign(<%- JSON.stringify(theme.plugins.heti) %>);
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- required -->
|
||||
|
|
|
@ -13,10 +13,14 @@ function layoutTitle() {
|
|||
return '';
|
||||
}
|
||||
}
|
||||
let post = page;
|
||||
let heti = '';
|
||||
if (theme.plugins.heti && theme.plugins.heti.enable) {
|
||||
heti = ' heti';
|
||||
}
|
||||
%>
|
||||
<% let post = page; %>
|
||||
<%- partial('_partial/main/navbar/breadcrumb') %>
|
||||
<article class='content heti md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
||||
<article class='content<%- heti %> md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
||||
<%- layoutTitle() %>
|
||||
<%- post.content %>
|
||||
<%- partial('_partial/main/article/article_footer') %>
|
||||
|
|
|
@ -296,3 +296,13 @@ if (stellar.plugins.fancybox) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
// heti
|
||||
if (stellar.plugins.heti) {
|
||||
stellar.loadCSS(stellar.plugins.heti.css);
|
||||
stellar.loadScript(stellar.plugins.heti.js, { defer: true }).then(function () {
|
||||
const heti = new Heti('.heti p');
|
||||
heti.autoSpacing();
|
||||
stellar.plugins.heti.enable = false;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue