2025-2-26-fixed
This commit is contained in:
17
themes/fluid/layout/_partials/archive-list.ejs
Normal file
17
themes/fluid/layout/_partials/archive-list.ejs
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="list-group">
|
||||
<p class="h4"><%= __(params.key + '.post_total', params.postTotal) %></p>
|
||||
<hr>
|
||||
<% var dateCursor %>
|
||||
<% page.posts.each(function (post) { %>
|
||||
<% if(date(post.date, "YYYY") !== dateCursor) { %>
|
||||
<% dateCursor = date(post.date, "YYYY") %>
|
||||
<p class="h5"><%= dateCursor %></p>
|
||||
<% } %>
|
||||
<a href="<%= url_for(post.path) %>" class="list-group-item list-group-item-action">
|
||||
<time><%= date(post.date, "MM-DD") %></time>
|
||||
<div class="list-group-item-title"><%= post.title %></div>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
|
||||
<%- partial('_partials/paginator') %>
|
||||
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
19
themes/fluid/layout/_partials/category-chains.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% function render_category_chain(cat) { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="category-chain-item"><%= cat.name.trim() %></a>
|
||||
<% var nextCats = categories.find({ parent: cat._id }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% if (nextCats.length > 0) { %>
|
||||
<span>></span>
|
||||
<%- render_category_chain(nextCats.data[0]) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<span class="category-chains">
|
||||
<% var catsFirst = categories.find({ parent: { $exists: false } }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
|
||||
<% catsFirst.each((cat, idx) => { %>
|
||||
<% if (typeof(limit) === "undefined" || idx < limit) { %>
|
||||
<span class="category-chain">
|
||||
<%- render_category_chain(cat) %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% }) %>
|
||||
</span>
|
||||
62
themes/fluid/layout/_partials/category-list.ejs
Normal file
62
themes/fluid/layout/_partials/category-list.ejs
Normal file
@ -0,0 +1,62 @@
|
||||
<% function render_categories(curCats, params = {}, depth = 0) { %>
|
||||
<% return curCats.each((cat) => { %>
|
||||
<% var subCats = site.categories.find({ parent: cat._id }).sort(params.orderBy || 'name').filter(cat => cat.length) %>
|
||||
<% var collapsed = subCats.length === 0 || depth >= theme.category.collapse_depth %>
|
||||
<% if ((params.filterIds || []).includes(cat._id)) collapsed = false %>
|
||||
<div class="<%= depth <= 0 ? 'category' : 'category-sub' %> row nomargin-x">
|
||||
<a class="<%= depth <= 0 ? 'category-item' : 'category-subitem' %> <%= collapsed ? 'collapsed' : '' %>
|
||||
list-group-item category-item-action col-10 col-md-11 col-xm-11" title="<%= cat.name.trim() %>"
|
||||
id="heading-<%= md5(cat.name) %>" role="tab" data-toggle="collapse" href="#collapse-<%= md5(cat.name) %>"
|
||||
aria-expanded="<%= collapsed ? 'false' : 'true' %>"
|
||||
>
|
||||
<%= cat.name.trim() %>
|
||||
<span class="list-group-count"><%= params.type === 'post' ? `(${ cat.posts.length })` : '' %></span>
|
||||
<i class="iconfont icon-arrowright"></i>
|
||||
</a>
|
||||
<% if(params.type !== 'post') { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="category-count col-2 col-md-1 col-xm-1">
|
||||
<i class="iconfont icon-articles"></i>
|
||||
<span><%= cat.posts.length %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<div class="category-collapse collapse <%= collapsed ? '' : 'show' %>" id="collapse-<%= md5(cat.name) %>"
|
||||
role="tabpanel" aria-labelledby="heading-<%= md5(cat.name) %>">
|
||||
<% var posts = cat.posts.sort(params.postOrderBy || '-date') %>
|
||||
<% if (subCats.length > 0) { %>
|
||||
<% var filteredPosts = posts.filter((p) => {
|
||||
return p.categories.filter(catOnPost => catOnPost.parent === cat._id).length === 0;
|
||||
}) %>
|
||||
<%- render_posts(filteredPosts, cat, params) %>
|
||||
<%- render_categories(subCats, params, depth + 1) %>
|
||||
<% } else { %>
|
||||
<%- render_posts(posts, cat, params) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
|
||||
<% function render_posts(posts, cat, params) { %>
|
||||
<div class="category-post-list">
|
||||
<% var limit = params.postLimit %>
|
||||
<% for (var idx = 0; idx < posts.length; idx++) { %>
|
||||
<% var post = posts.data[idx] %>
|
||||
<% if (idx && limit && idx >= limit) { %>
|
||||
<a href="<%= url_for(cat.path) %>" class="list-group-item list-group-item-action">
|
||||
<span class="category-post"><%- __('category.more') %></span>
|
||||
</a>
|
||||
<% break %>
|
||||
<% } else { %>
|
||||
<a href="<%= url_for(post.path) %>" title="<%= post.title %>"
|
||||
class="list-group-item list-group-item-action
|
||||
<%= (params.filterIds || []).includes(post._id) ? 'active' : '' %>">
|
||||
<span class="category-post"><%= post.title %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<div class="category-list">
|
||||
<%- render_categories(curCats, params) %>
|
||||
</div>
|
||||
8
themes/fluid/layout/_partials/comments.ejs
Normal file
8
themes/fluid/layout/_partials/comments.ejs
Normal file
@ -0,0 +1,8 @@
|
||||
<% if ((!is_post() && !is_page()) || (is_post() && theme.post.comments.enable && page.comments) || (is_page() && page.comments)) { %>
|
||||
<% var commentType = typeof page.comment === 'string' && page.comment !== '' ? page.comment : theme.post.comments.type %>
|
||||
<% if (commentType) { %>
|
||||
<article id="comments">
|
||||
<%- partial('_partials/comments/' + commentType) %>
|
||||
</article>
|
||||
<% } %>
|
||||
<% } %>
|
||||
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
11
themes/fluid/layout/_partials/comments/changyan.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<% if (theme.changyan.appid) { %>
|
||||
<div id="SOHUCS" sid='<%= page.permalink %>'></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#SOHUCS', function() {
|
||||
Fluid.utils.createScript("https://changyan.sohu.com/upload/changyan.js", function() {
|
||||
window.changyan.api.config(<%- JSON.stringify(theme.changyan || {}) %>)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
25
themes/fluid/layout/_partials/comments/cusdis.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.cusdis.host && theme.cusdis.app_id) { %>
|
||||
<div class="cusdis" style="width:100%">
|
||||
<div id="cusdis_thread"
|
||||
data-host="<%= theme.cusdis.host %>"
|
||||
data-app-id="<%= theme.cusdis.app_id %>"
|
||||
data-page-id="<%= md5(page.path) %>"
|
||||
data-page-url="<%= page.path %>"
|
||||
data-page-title="<%= page.title %>"
|
||||
data-theme="<%= theme.dark_mode.default %>"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#cusdis_thread', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host,
|
||||
`/js/widget/lang/${ String(theme.cusdis.lang || 'zh-cn').toLowerCase() }.js`) %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.cusdis.host, 'js/cusdis.es.js') %>');
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema) {
|
||||
document.querySelector('#cusdis_thread').dataset.theme = schema
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
17
themes/fluid/layout/_partials/comments/discuss.ejs
Normal file
@ -0,0 +1,17 @@
|
||||
<% if (theme.discuss && theme.discuss.serverURLs) { %>
|
||||
<div id="discuss-comments"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.discuss, 'discuss.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.discuss || {}) %>,
|
||||
{ el: '#discuss-comments',
|
||||
path: <%= theme.discuss.path %>
|
||||
}
|
||||
)
|
||||
discuss.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
32
themes/fluid/layout/_partials/comments/disqus.ejs
Normal file
@ -0,0 +1,32 @@
|
||||
<% if (theme.disqus.shortname) { %>
|
||||
<div class="disqus" style="width:100%">
|
||||
<div id="disqus_thread"></div>
|
||||
<% if (theme.disqus.disqusjs) { %>
|
||||
<script>
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.disqusjs, 'disqusjs.css') %>');
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.disqusjs, 'disqus.js') %>', function() {
|
||||
new DisqusJS({
|
||||
shortname: '<%= theme.disqus.shortname %>',
|
||||
apikey: '<%= theme.disqus.apikey %>'
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } else { %>
|
||||
<script type="text/javascript">
|
||||
var disqus_config = function() {
|
||||
this.page.url = '<%= page.permalink %>';
|
||||
this.page.identifier = '<%= url_for(page.path) %>';
|
||||
};
|
||||
Fluid.utils.loadComments('#disqus_thread', function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = '//' + '<%= theme.disqus.shortname %>' + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
36
themes/fluid/layout/_partials/comments/giscus.ejs
Normal file
@ -0,0 +1,36 @@
|
||||
<% if (theme.giscus && theme.giscus['repo'] && theme.giscus['repo-id']) { %>
|
||||
<div id="giscus" class="giscus"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#giscus', function() {
|
||||
var options = <%- JSON.stringify(theme.giscus || {}) %>;
|
||||
var attributes = {};
|
||||
for (let option in options) {
|
||||
if (!option.startsWith('theme-')) {
|
||||
var key = option.startsWith('data-') ? option : 'data-' + option;
|
||||
attributes[key] = options[option];
|
||||
}
|
||||
}
|
||||
var light = '<%= theme.giscus['theme-light'] || 'light' %>';
|
||||
var dark = '<%= theme.giscus['theme-dark'] || 'dark' %>';
|
||||
window.GiscusThemeLight = light;
|
||||
window.GiscusThemeDark = dark;
|
||||
attributes['data-theme'] = document.documentElement.getAttribute('data-user-color-scheme') === 'dark' ? dark : light;
|
||||
for (let attribute in attributes) {
|
||||
var value = attributes[attribute];
|
||||
if (value === undefined || value === null || value === '') {
|
||||
delete attributes[attribute];
|
||||
}
|
||||
}
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://giscus.app/client.js');
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
for (let attribute in attributes) {
|
||||
s.setAttribute(attribute, attributes[attribute]);
|
||||
}
|
||||
var ss = document.getElementsByTagName('script');
|
||||
var e = ss.length > 0 ? ss[ss.length - 1] : document.head || document.documentElement;
|
||||
e.parentNode.insertBefore(s, e.nextSibling);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
19
themes/fluid/layout/_partials/comments/gitalk.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% if(theme.gitalk.clientID && theme.gitalk.clientSecret && theme.gitalk.repo){ %>
|
||||
<div id="gitalk-container"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#gitalk-container', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.internal_css, 'gitalk.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.gitalk, 'gitalk.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.gitalk || {}) %>,
|
||||
{
|
||||
id: '<%= md5(page.path) %>'
|
||||
}
|
||||
)
|
||||
var gitalk = new Gitalk(options);
|
||||
gitalk.render('gitalk-container');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
10
themes/fluid/layout/_partials/comments/livere.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if (theme.livere.uid) { %>
|
||||
<div id="lv-container" data-id="city" data-uid="<%= theme.livere.uid %>">
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#lv-container', function() {
|
||||
Fluid.utils.createScript('https://cdn-city.livere.com/js/embed.dist.js');
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
</div>
|
||||
<% } %>
|
||||
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
29
themes/fluid/layout/_partials/comments/remark42.ejs
Normal file
@ -0,0 +1,29 @@
|
||||
<% if (theme.remark42.host && theme.remark42.site_id) { %>
|
||||
<div id="remark42"></div>
|
||||
<script type="text/javascript">
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema !== 'light' && schema !== 'dark') {
|
||||
schema = 'light';
|
||||
}
|
||||
var remark_config = Object.assign(
|
||||
<%- JSON.stringify(theme.remark42 || {}) %>,
|
||||
{
|
||||
url: '<%= url_for(page.path) %>',
|
||||
page_title: '<%= page.title %>',
|
||||
theme: schema,
|
||||
}
|
||||
);
|
||||
|
||||
Fluid.utils.loadComments('#remark42', function() {
|
||||
(function (c) {
|
||||
for (var i = 0; i < c.length; i++) {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = remark_config.host + '/web/' + c[i] + '.js';
|
||||
s.defer = true;
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
})(remark_config.components || ['embed']);
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
25
themes/fluid/layout/_partials/comments/twikoo.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<% if (theme.twikoo && theme.twikoo.envId) { %>
|
||||
<div id="twikoo"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.twikoo, 'twikoo.all.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.twikoo || {}) %>,
|
||||
{
|
||||
el: '#twikoo',
|
||||
path: '<%= theme.twikoo.path %>',
|
||||
onCommentLoaded: function() {
|
||||
Fluid.utils.listenDOMLoaded(function() {
|
||||
var imgSelector = '#twikoo .tk-content img:not(.tk-owo-emotion)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
twikoo.init(options)
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
27
themes/fluid/layout/_partials/comments/utterances.ejs
Normal file
@ -0,0 +1,27 @@
|
||||
<% if (theme.utterances.repo && theme.utterances.issue_term) { %>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#comments', function() {
|
||||
var light = '<%= theme.utterances.theme || 'github-light' %>';
|
||||
var dark = '<%= theme.utterances.theme_dark || 'github-dark' %>';
|
||||
var schema = document.documentElement.getAttribute('data-user-color-scheme');
|
||||
if (schema === 'dark') {
|
||||
schema = dark;
|
||||
} else {
|
||||
schema = light;
|
||||
}
|
||||
window.UtterancesThemeLight = light;
|
||||
window.UtterancesThemeDark = dark;
|
||||
var s = document.createElement('script');
|
||||
s.setAttribute('src', 'https://utteranc.es/client.js');
|
||||
s.setAttribute('repo', '<%= theme.utterances.repo %>');
|
||||
s.setAttribute('issue-term', '<%= theme.utterances.issue_term %>');
|
||||
<% if (theme.utterances.label) { %>
|
||||
s.setAttribute('label', '<%= theme.utterances.label %>');
|
||||
<% } %>
|
||||
s.setAttribute('theme', schema);
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
document.getElementById('comments').appendChild(s);
|
||||
})
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
23
themes/fluid/layout/_partials/comments/valine.ejs
Normal file
@ -0,0 +1,23 @@
|
||||
<% if (theme.valine.appId && theme.valine.appKey) { %>
|
||||
<div id="valine"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#valine', function() {
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine, 'Valine.min.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.valine || {}) %>,
|
||||
{
|
||||
el: "#valine",
|
||||
path: <%= theme.valine.path %>
|
||||
}
|
||||
)
|
||||
new Valine(options);
|
||||
Fluid.utils.waitElementVisible('#valine .vcontent', () => {
|
||||
var imgSelector = '#valine .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
24
themes/fluid/layout/_partials/comments/waline.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<% if (theme.waline.serverURL) { %>
|
||||
<div id="waline"></div>
|
||||
<script type="text/javascript">
|
||||
Fluid.utils.loadComments('#waline', function() {
|
||||
Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.waline, 'waline.css') %>')
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'waline.js') %>', function() {
|
||||
var options = Object.assign(
|
||||
<%- JSON.stringify(theme.waline || {}) %>,
|
||||
{
|
||||
el: '#waline',
|
||||
path: <%= theme.waline.path %>
|
||||
}
|
||||
)
|
||||
Waline.init(options);
|
||||
Fluid.utils.waitElementVisible('#waline .vcontent', () => {
|
||||
var imgSelector = '#waline .vcontent img:not(.vemoji)';
|
||||
Fluid.plugins.imageCaption(imgSelector);
|
||||
Fluid.plugins.fancyBox(imgSelector);
|
||||
})
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the comments</noscript>
|
||||
<% } %>
|
||||
26
themes/fluid/layout/_partials/css.ejs
Normal file
26
themes/fluid/layout/_partials/css.ejs
Normal file
@ -0,0 +1,26 @@
|
||||
<%- css_ex(theme.static_prefix.bootstrap, 'css/bootstrap.min.css') %>
|
||||
|
||||
<% var css_snippets = deduplicate(page.css_snippets) %>
|
||||
<% for (var idx = 0; idx < css_snippets.length; idx++) { %>
|
||||
<%- css_snippets[idx] %>
|
||||
<% } %>
|
||||
<% page.css_snippets = [] %>
|
||||
|
||||
<!-- 主题依赖的图标库,不要自行修改 -->
|
||||
<!-- Do not modify the link that theme dependent icons -->
|
||||
<%- css('//at.alicdn.com/t/c/font_1749284_5i9bdhy70f8.css') %>
|
||||
|
||||
<%- css(theme.static_prefix.iconfont || theme.iconfont) %>
|
||||
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'main.css') %>
|
||||
|
||||
<% if (theme.code.highlight.enable) { %>
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'highlight.css', 'id="highlight-css"') %>
|
||||
<% if (theme.dark_mode.enable) { %>
|
||||
<%- css_ex(theme.static_prefix.internal_css, 'highlight-dark.css', 'id="highlight-css-dark"') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.custom_css) { %>
|
||||
<%- css(theme.custom_css) %>
|
||||
<% } %>
|
||||
34
themes/fluid/layout/_partials/footer.ejs
Normal file
34
themes/fluid/layout/_partials/footer.ejs
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="footer-inner">
|
||||
<% if (theme.footer.content) { %>
|
||||
<div class="footer-content">
|
||||
<%- theme.footer.content %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- 添加 logo 贴纸 -->
|
||||
<div class="footer-logos">
|
||||
<a href="https://archlinux.org" target="_blank">
|
||||
<img src="/images/archlinux-logo.png" alt="Arch Linux Logo" width="80">
|
||||
</a>
|
||||
<a href="https://kde.org" target="_blank">
|
||||
<img src="/images/built_on_the_kde_platform.png" alt="Built on the KDE Platform" width="80">
|
||||
</a>
|
||||
<a href="https://amd.com" target="_blank">
|
||||
<img src="/images/amd.webp" alt="AMD Logo" width="80">
|
||||
</a>
|
||||
<a href="https://www.asc-events.net/" target="_blank">
|
||||
<img src="/images/asc-events.png" alt="ASC-Events" width="80">
|
||||
</a>
|
||||
<a href="https://notbyai.fyi/" target="_blank">
|
||||
<img src="/images/Written-By-Human-Not-By-AI-Badge-white@2x.png" alt="Written By Human Not By AI Badge" width="80">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% if (theme.footer.statistics.enable) { %>
|
||||
<%- partial('_partials/footer/statistics.ejs') %>
|
||||
<% } %>
|
||||
<% if(theme.footer.beian.enable) { %>
|
||||
<!-- 备案信息 ICP for China -->
|
||||
<%- partial('_partials/footer/beian.ejs') %>
|
||||
<% } %>
|
||||
</div>
|
||||
33
themes/fluid/layout/_partials/footer/beian.ejs
Normal file
33
themes/fluid/layout/_partials/footer/beian.ejs
Normal file
@ -0,0 +1,33 @@
|
||||
<div class="beian">
|
||||
<span>
|
||||
<a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
|
||||
<%- theme.footer.beian.icp_text %>
|
||||
</a>
|
||||
</span>
|
||||
<% if(theme.footer.beian.police_text) { %>
|
||||
<% if(theme.footer.beian.police_code) { %>
|
||||
<span>
|
||||
<a
|
||||
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%= theme.footer.beian.police_code %>"
|
||||
rel="nofollow noopener"
|
||||
class="beian-police"
|
||||
target="_blank"
|
||||
>
|
||||
<% if(theme.footer.beian.police_icon) { %>
|
||||
<span style="visibility: hidden; width: 0">|</span>
|
||||
<img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
|
||||
<% } %>
|
||||
<span><%- theme.footer.beian.police_text %></span>
|
||||
</a>
|
||||
</span>
|
||||
<% } else { %>
|
||||
<span class="beian-police">
|
||||
<% if(theme.footer.beian.police_icon) { %>
|
||||
<span style="visibility: hidden; width: 0">|</span>
|
||||
<img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
|
||||
<% } %>
|
||||
<span class="beian-police"><%- theme.footer.beian.police_text %></span>
|
||||
</span>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
57
themes/fluid/layout/_partials/footer/statistics.ejs
Normal file
57
themes/fluid/layout/_partials/footer/statistics.ejs
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="statistics">
|
||||
<% let pv_texts = (theme.footer.statistics.pv_format || __('footer.pv')).split('{}') %>
|
||||
<% let uv_texts = (theme.footer.statistics.uv_format || __('footer.uv')).split('{}') %>
|
||||
|
||||
<% if (theme.footer.statistics.source === 'leancloud') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="leancloud-site-pv-container" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="leancloud-site-pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="leancloud-site-uv-container" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="leancloud-site-uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.footer.statistics.source === 'busuanzi') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="busuanzi_container_site_pv" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="busuanzi_value_site_pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="busuanzi_container_site_uv" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="busuanzi_value_site_uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.footer.statistics.source === 'umami') { %>
|
||||
<% if (pv_texts.length >= 2) { %>
|
||||
<span id="umami-site-pv-container" style="display: none">
|
||||
<%- pv_texts[0] %>
|
||||
<span id="umami-site-pv"></span>
|
||||
<%- pv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (uv_texts.length >= 2) { %>
|
||||
<span id="umami-site-uv-container" style="display: none">
|
||||
<%- uv_texts[0] %>
|
||||
<span id="umami-site-uv"></span>
|
||||
<%- uv_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'umami-view.js', 'defer') %>
|
||||
<% } %>
|
||||
|
||||
</div>
|
||||
54
themes/fluid/layout/_partials/head.ejs
Normal file
54
themes/fluid/layout/_partials/head.ejs
Normal file
@ -0,0 +1,54 @@
|
||||
<%
|
||||
var separator = theme.title_join_string || theme.tab_title_separator
|
||||
var title = page.title ? [page.title, config.title].join(separator) : config.title
|
||||
var keywords = page.keywords || config.keywords
|
||||
if (keywords instanceof Array) {
|
||||
keywords = keywords.join(',')
|
||||
}
|
||||
var description = page.description || page.excerpt || (is_post() && page.content) || config.description
|
||||
if (description) {
|
||||
description = strip_html(description).substring(0, 200).trim().replace(/\n/g, ' ')
|
||||
}
|
||||
var ogImage = page.og_img || page.index_img
|
||||
var ogConfig = Object.assign({ image: ogImage && url_for(ogImage) }, theme.open_graph)
|
||||
%>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<%= url_for(theme.apple_touch_icon) %>">
|
||||
<link rel="icon" href="<%= url_for(theme.favicon) %>">
|
||||
<% if (theme.canonical.enable) { %>
|
||||
<link rel="canonical" href="<%= url_join(config.url, page.canonical_path.replace('index.html', '')) %>"/>
|
||||
<% } %>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<% if (theme.force_https) { %>
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<% } %>
|
||||
<meta name="theme-color" content="<%= theme.color.navbar_bg_color %>">
|
||||
<meta name="author" content="<%= page.author || config.author %>">
|
||||
<meta name="keywords" content="<%= keywords %>">
|
||||
<% if (theme.open_graph.enable) { %>
|
||||
<%- open_graph(ogConfig) %>
|
||||
<% } else { %>
|
||||
<meta name="description" content="<%= description %>">
|
||||
<% } %>
|
||||
<% if ((theme.post.meta.views.enable && theme.post.meta.views.source === 'busuanzi')
|
||||
|| (theme.footer.statistics.enable && theme.footer.statistics.source === 'busuanzi')) { %>
|
||||
<meta name="referrer" content="no-referrer-when-downgrade">
|
||||
<% } %>
|
||||
<% if (theme.custom_head) { %>
|
||||
<%- theme.custom_head %>
|
||||
<% } %>
|
||||
<title><%= title %></title>
|
||||
|
||||
<%- partial('_partials/css.ejs') %>
|
||||
<%- export_config() %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'utils.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'color-schema.js') %>
|
||||
<%- partial('_partials/plugins/analytics.ejs') %>
|
||||
|
||||
<%- inject_point('head') %>
|
||||
</head>
|
||||
8
themes/fluid/layout/_partials/header.ejs
Normal file
8
themes/fluid/layout/_partials/header.ejs
Normal file
@ -0,0 +1,8 @@
|
||||
<%
|
||||
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
|
||||
%>
|
||||
|
||||
<div class="header-inner" style="height: <%= banner_img_height %>vh;">
|
||||
<%- partial('_partials/header/navigation') %>
|
||||
<%- partial('_partials/header/banner') %>
|
||||
</div>
|
||||
33
themes/fluid/layout/_partials/header/banner.ejs
Normal file
33
themes/fluid/layout/_partials/header/banner.ejs
Normal file
@ -0,0 +1,33 @@
|
||||
<%
|
||||
var banner_img = page.banner_img || theme.index.banner_img
|
||||
var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
|
||||
var banner_mask_alpha = parseFloat(page.banner_mask_alpha || theme.index.banner_mask_alpha)
|
||||
var subtitle = page.subtitle || page.title
|
||||
%>
|
||||
|
||||
<div id="banner" class="banner" <%- theme.banner && theme.banner.parallax && 'parallax=true' %>
|
||||
style="background: url('<%- url_for(banner_img) %>') no-repeat center center; background-size: cover;">
|
||||
<div class="full-bg-img">
|
||||
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, <%= parseFloat(banner_mask_alpha) %>)">
|
||||
<div class="banner-text text-center fade-in-up">
|
||||
<div class="h2">
|
||||
<% if(theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope)) { %>
|
||||
<span id="subtitle" data-typed-text="<%= subtitle %>"></span>
|
||||
<% } else { %>
|
||||
<span id="subtitle"><%- subtitle %></span>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (is_post()) { %>
|
||||
<%- inject_point('postMetaTop') %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (theme.scroll_down_arrow.enable && theme.scroll_down_arrow.banner_height_limit <= banner_img_height && page.layout !== '404') { %>
|
||||
<div class="scroll-down-bar">
|
||||
<i class="iconfont icon-arrowdown"></i>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
70
themes/fluid/layout/_partials/header/navigation.ejs
Normal file
70
themes/fluid/layout/_partials/header/navigation.ejs
Normal file
@ -0,0 +1,70 @@
|
||||
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="<%= url_for() %>">
|
||||
<strong><%= theme.navbar.blog_title || config.title %></strong>
|
||||
</a>
|
||||
|
||||
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<div class="animated-icon"><span></span><span></span><span></span></div>
|
||||
</button>
|
||||
|
||||
<!-- Collapsible content -->
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto text-center">
|
||||
<% for(const each of theme.navbar.menu || []) { %>
|
||||
<% if (!each.submenu && !each.link) continue %>
|
||||
<% var text = each.name || __(each.key + '.menu') || __(each.key + '.title') %>
|
||||
<% if (text.indexOf('.menu') !== -1 || text.indexOf('.title') !== -1) {
|
||||
text = each.key
|
||||
} %>
|
||||
<% if (each.submenu) { %>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" target="_self" href="javascript:;" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<%- each.icon ? '<i class="' + each.icon + '"></i>' : '' %>
|
||||
<span><%- text %></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<% for(const subEach of each.submenu || []) { %>
|
||||
<% if (!subEach.link) continue %>
|
||||
<% var subText = subEach.name || __(subEach.key + '.title') %>
|
||||
<% if (subText.indexOf('.title') !== -1) {
|
||||
subText = subEach.key
|
||||
} %>
|
||||
<a class="dropdown-item" href="<%= url_for(subEach.link) %>" target="<%= subEach.target || '_self' %>">
|
||||
<%- subEach.icon ? '<i class="' + subEach.icon + '"></i>' : '' %>
|
||||
<span><%- subText %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
</div>
|
||||
</li>
|
||||
<% } else { %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%= url_for(each.link) %>" target="<%= each.target || '_self' %>">
|
||||
<%- each.icon ? '<i class="' + each.icon + '"></i>' : '' %>
|
||||
<span><%- text %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if(theme.search.enable) { %>
|
||||
<li class="nav-item" id="search-btn">
|
||||
<a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
|
||||
<i class="iconfont icon-search"></i>
|
||||
</a>
|
||||
</li>
|
||||
<% import_js(theme.static_prefix.internal_js, 'local-search.js') %>
|
||||
<% } %>
|
||||
<% if(theme.dark_mode && theme.dark_mode.enable) { %>
|
||||
<li class="nav-item" id="color-toggle-btn">
|
||||
<a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
|
||||
<i class="iconfont icon-dark" id="color-toggle-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
24
themes/fluid/layout/_partials/markdown-plugins.ejs
Normal file
24
themes/fluid/layout/_partials/markdown-plugins.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<% import_css(theme.static_prefix.github_markdown, 'github-markdown.min.css') %>
|
||||
<% import_css(theme.static_prefix.hint, 'hint.min.css') %>
|
||||
|
||||
<% if (theme.code.highlight.enable) { %>
|
||||
<%- partial('_partials/plugins/highlight.ejs') %>
|
||||
<% } %>
|
||||
<% if ((theme.code.language.enable && theme.code.language.default) || theme.code.copy_btn) { %>
|
||||
<%- partial('_partials/plugins/code-widget.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.fun_features.anchorjs.enable && page.anchorjs !== false) { %>
|
||||
<%- partial('_partials/plugins/anchorjs.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.image_zoom.enable && page.image_zoom !== false) { %>
|
||||
<%- partial('_partials/plugins/fancybox.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.image_caption.enable) { %>
|
||||
<% import_script('<script>Fluid.plugins.imageCaption();</script>') %>
|
||||
<% } %>
|
||||
<% if (theme.post.math.enable && (!theme.post.math.specific || (theme.post.math.specific && page.math))) { %>
|
||||
<%- partial('_partials/plugins/math.ejs') %>
|
||||
<% } %>
|
||||
<% if (theme.post.mermaid.enable && (!theme.post.mermaid.specific || (theme.post.mermaid.specific && page.mermaid))) { %>
|
||||
<%- partial('_partials/plugins/mermaid.ejs') %>
|
||||
<% } %>
|
||||
14
themes/fluid/layout/_partials/paginator.ejs
Normal file
14
themes/fluid/layout/_partials/paginator.ejs
Normal file
@ -0,0 +1,14 @@
|
||||
<% if (page.total > 1){ %>
|
||||
<nav aria-label="navigation">
|
||||
<span class="pagination" id="pagination">
|
||||
<%- paginator({
|
||||
prev_text: '<i class="iconfont icon-arrowleft"></i>',
|
||||
next_text: '<i class="iconfont icon-arrowright"></i>',
|
||||
mid_size: 2,
|
||||
end_size: 1,
|
||||
format: `${config.pagination_dir}/%d/${theme.scroll_down_arrow.scroll_after_turning_page ? '#board' : ''}`,
|
||||
escape: false
|
||||
}) %>
|
||||
</span>
|
||||
</nav>
|
||||
<% } %>
|
||||
70
themes/fluid/layout/_partials/plugins/analytics.ejs
Normal file
70
themes/fluid/layout/_partials/plugins/analytics.ejs
Normal file
@ -0,0 +1,70 @@
|
||||
<% if (theme.web_analytics.enable) { %>
|
||||
|
||||
<% if(theme.web_analytics.baidu) { %>
|
||||
<!-- Baidu Analytics -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?<%= theme.web_analytics.baidu %>";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.web_analytics.google && theme.web_analytics.google.measurement_id){ %>
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
Fluid.utils.createScript("https://www.googletagmanager.com/gtag/js?id=<%= theme.web_analytics.google.measurement_id %>", function() {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '<%= theme.web_analytics.google.measurement_id %>');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.umami && theme.web_analytics.umami.src && theme.web_analytics.umami.website_id) { %>
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
let umami = document.createElement('script');
|
||||
umami.async = true;
|
||||
umami.src = "<%= theme.web_analytics.umami.src %>";
|
||||
umami.setAttribute("data-website-id", "<%= theme.web_analytics.umami.website_id %>");
|
||||
umami.setAttribute("data-domains", "<%= theme.web_analytics.umami.domains %>");
|
||||
document.head.appendChild(umami);
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.tencent && theme.web_analytics.tencent.sid && theme.web_analytics.tencent.cid) { %>
|
||||
<!-- Tencent Analytics -->
|
||||
<script async>
|
||||
if (!Fluid.ctx.dnt) {
|
||||
var _mtac = {};
|
||||
(function() {
|
||||
var mta = document.createElement("script");
|
||||
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
|
||||
mta.setAttribute("name", "MTAH5");
|
||||
mta.setAttribute("sid", "<%= theme.web_analytics.tencent.sid %>");
|
||||
<% if(theme.web_analytics.tencent.cid) { %>
|
||||
mta.setAttribute("cid", "<%= theme.web_analytics.tencent.cid %>");
|
||||
<% } %>
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(mta, s);
|
||||
})();
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.leancloud && theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key) { %>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
39
themes/fluid/layout/_partials/plugins/anchorjs.ejs
Normal file
39
themes/fluid/layout/_partials/plugins/anchorjs.ejs
Normal file
@ -0,0 +1,39 @@
|
||||
<%
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${ url_join(theme.static_prefix.anchor, 'anchor.min.js') }', function() {
|
||||
window.anchors.options = {
|
||||
placement: CONFIG.anchorjs.placement,
|
||||
visible : CONFIG.anchorjs.visible
|
||||
};
|
||||
if (CONFIG.anchorjs.icon) {
|
||||
window.anchors.options.icon = CONFIG.anchorjs.icon;
|
||||
}
|
||||
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
|
||||
var res = [];
|
||||
for (var item of el) {
|
||||
res.push('.markdown-body > ' + item.trim());
|
||||
}
|
||||
if (CONFIG.anchorjs.placement === 'left') {
|
||||
window.anchors.options.class = 'anchorjs-link-left';
|
||||
}
|
||||
window.anchors.add(res.join(', '));
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('anchors' in window) {
|
||||
anchors.removeAll();
|
||||
var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
|
||||
var res = [];
|
||||
for (var item of el) {
|
||||
res.push('.markdown-body > ' + item.trim());
|
||||
}
|
||||
if (CONFIG.anchorjs.placement === 'left') {
|
||||
anchors.options.class = 'anchorjs-link-left';
|
||||
}
|
||||
anchors.add(res.join(', '));
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
7
themes/fluid/layout/_partials/plugins/code-widget.ejs
Normal file
7
themes/fluid/layout/_partials/plugins/code-widget.ejs
Normal file
@ -0,0 +1,7 @@
|
||||
<%
|
||||
if (theme.code.copy_btn) {
|
||||
import_script(`<script src=${url_join(theme.static_prefix.clipboard, 'clipboard.min.js')}></script>`)
|
||||
}
|
||||
import_script(`<script>Fluid.plugins.codeWidget();</script>
|
||||
`)
|
||||
%>
|
||||
18
themes/fluid/layout/_partials/plugins/encrypt.ejs
Normal file
18
themes/fluid/layout/_partials/plugins/encrypt.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
import_script(`
|
||||
<script defer>
|
||||
if (document.getElementById('hbePass') || document.querySelector('hbe-prefix')) {
|
||||
Fluid.utils.waitElementLoaded('hbe-prefix', function() {
|
||||
var hbePrefix = document.querySelector('hbe-prefix');
|
||||
hbePrefix.parentElement.classList.add('markdown-body');
|
||||
Fluid.utils.retry(function() {
|
||||
if (Fluid.boot && Fluid.boot.refresh) {
|
||||
Fluid.boot.refresh();
|
||||
return true;
|
||||
}
|
||||
}, 100, 10);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
11
themes/fluid/layout/_partials/plugins/fancybox.ejs
Normal file
11
themes/fluid/layout/_partials/plugins/fancybox.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<%
|
||||
import_css(theme.static_prefix.fancybox, 'jquery.fancybox.min.css')
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.fancybox, 'jquery.fancybox.min.js')}', function() {
|
||||
Fluid.plugins.fancyBox();
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
13
themes/fluid/layout/_partials/plugins/highlight.ejs
Normal file
13
themes/fluid/layout/_partials/plugins/highlight.ejs
Normal file
@ -0,0 +1,13 @@
|
||||
<%
|
||||
if (theme.code.highlight.lib === 'prismjs') {
|
||||
if (!theme.code.highlight.prismjs.preprocess) {
|
||||
import_js(theme.static_prefix.prismjs, 'components/prism-core.min.js')
|
||||
import_js(theme.static_prefix.prismjs, 'plugins/autoloader/prism-autoloader.min.js')
|
||||
}
|
||||
|
||||
if (theme.code.highlight.line_number) {
|
||||
import_css(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.css')
|
||||
import_js(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.js')
|
||||
}
|
||||
}
|
||||
%>
|
||||
51
themes/fluid/layout/_partials/plugins/math.ejs
Normal file
51
themes/fluid/layout/_partials/plugins/math.ejs
Normal file
@ -0,0 +1,51 @@
|
||||
<% if(theme.post.math.engine === 'mathjax') { %>
|
||||
<%
|
||||
var lazy = theme.lazyload.enable && require_version(theme.static_prefix.mathjax, '3.2.0')
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
if (!window.MathJax) {
|
||||
window.MathJax = {
|
||||
tex : {
|
||||
inlineMath: { '[+]': [['$', '$']] }
|
||||
},
|
||||
loader : {
|
||||
${ lazy ? 'load: \[\'ui/lazy\'\]' : '' }
|
||||
},
|
||||
options: {
|
||||
renderActions: {
|
||||
insertedScript: [200, () => {
|
||||
document.querySelectorAll('mjx-container').forEach(node => {
|
||||
let target = node.parentNode;
|
||||
if (target.nodeName.toLowerCase() === 'li') {
|
||||
target.parentNode.classList.add('has-jax');
|
||||
}
|
||||
});
|
||||
}, '', false]
|
||||
}
|
||||
}
|
||||
};
|
||||
} else {
|
||||
MathJax.startup.document.state(0);
|
||||
MathJax.texReset();
|
||||
MathJax.typeset();
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
|
||||
MathJax.startup.document.state(0);
|
||||
MathJax.texReset();
|
||||
MathJax.typeset();
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
|
||||
import_js(theme.static_prefix.mathjax.replace('es5/', ''), 'es5/tex-mml-chtml.js')
|
||||
%>
|
||||
|
||||
<% } else if (theme.post.math.engine === 'katex') { %>
|
||||
<% import_css(theme.static_prefix.katex, 'katex.min.css') %>
|
||||
<% } %>
|
||||
13
themes/fluid/layout/_partials/plugins/mermaid.ejs
Normal file
13
themes/fluid/layout/_partials/plugins/mermaid.ejs
Normal file
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
Fluid.utils.createScript('<%= url_join(theme.static_prefix.mermaid, 'mermaid.min.js') %>', function() {
|
||||
mermaid.initialize(<%- JSON.stringify(theme.post.mermaid.options || {}) %>);
|
||||
|
||||
Fluid.utils.listenDOMLoaded(function() {
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('mermaid' in window) {
|
||||
mermaid.init();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
30
themes/fluid/layout/_partials/plugins/moment.ejs
Normal file
30
themes/fluid/layout/_partials/plugins/moment.ejs
Normal file
@ -0,0 +1,30 @@
|
||||
<%
|
||||
var lang = (config.language || 'zh-cn').toLowerCase();
|
||||
|
||||
import_script(`
|
||||
<script>
|
||||
var relativeDate = function() {
|
||||
var updatedTime = document.getElementById('updated-time');
|
||||
if (updatedTime) {
|
||||
var text = updatedTime.textContent;
|
||||
var reg = /\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2})/;
|
||||
var matchs = text.match(reg);
|
||||
if (matchs) {
|
||||
var relativeTime = moment(matchs[0]).fromNow();
|
||||
updatedTime.textContent = text.replace(reg, relativeTime);
|
||||
}
|
||||
updatedTime.style.display = '';
|
||||
}
|
||||
};
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.moment, 'moment.min.js')}', function() {
|
||||
if (!'${lang}'.startsWith('en')) {
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.moment, 'locale/' + lang + '.min.js')}', function() {
|
||||
relativeDate();
|
||||
});
|
||||
} else {
|
||||
relativeDate();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
12
themes/fluid/layout/_partials/plugins/nprogress.ejs
Normal file
12
themes/fluid/layout/_partials/plugins/nprogress.ejs
Normal file
@ -0,0 +1,12 @@
|
||||
<% if (theme.fun_features.progressbar && theme.fun_features.progressbar.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.nprogress, 'nprogress.min.js') %>
|
||||
<%- css_ex(theme.static_prefix.nprogress, 'nprogress.min.css') %>
|
||||
|
||||
<script>
|
||||
NProgress.configure(<%- JSON.stringify(theme.fun_features.progressbar.options || '{}') %>)
|
||||
NProgress.start()
|
||||
window.addEventListener('load', function() {
|
||||
NProgress.done();
|
||||
})
|
||||
</script>
|
||||
<% } %>
|
||||
48
themes/fluid/layout/_partials/plugins/typed.ejs
Normal file
48
themes/fluid/layout/_partials/plugins/typed.ejs
Normal file
@ -0,0 +1,48 @@
|
||||
<% if(theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope) && page.subtitle !== false) { %>
|
||||
<%- js_ex(theme.static_prefix.typed, '/typed.min.js') %>
|
||||
<script>
|
||||
(function (window, document) {
|
||||
var typing = Fluid.plugins.typing;
|
||||
var subtitle = document.getElementById('subtitle');
|
||||
if (!subtitle || !typing) {
|
||||
return;
|
||||
}
|
||||
var text = subtitle.getAttribute('data-typed-text');
|
||||
<% if (is_home() && theme.index.slogan.api && theme.index.slogan.api.enable) { %>
|
||||
jQuery.ajax({
|
||||
type: '<%= theme.index.slogan.api.method %>',
|
||||
url: '<%- theme.index.slogan.api.url %>',
|
||||
headers: <%- JSON.stringify(theme.index.slogan.api.headers || {}) %>,
|
||||
dataType: 'json',
|
||||
success: function(result) {
|
||||
var apiText;
|
||||
if (result) {
|
||||
var keys = '<%= theme.index.slogan.api.keys %>'.split(',');
|
||||
if (result instanceof Array) {
|
||||
result = result[0];
|
||||
}
|
||||
for (const k of keys) {
|
||||
var value = result[k];
|
||||
if (typeof value === 'string') {
|
||||
apiText = value;
|
||||
break;
|
||||
} else if (value instanceof Object) {
|
||||
result = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
apiText ? typing(apiText) : typing(text);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
if (error) {
|
||||
console.error('Failed to request <%= theme.index.slogan.api.url %>:', error);
|
||||
}
|
||||
typing(text);
|
||||
}
|
||||
})
|
||||
<% } else { %>
|
||||
typing(text);
|
||||
<% } %>
|
||||
})(window, document);
|
||||
</script>
|
||||
<% } %>
|
||||
18
themes/fluid/layout/_partials/post/category-bar.ejs
Normal file
18
themes/fluid/layout/_partials/post/category-bar.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<%
|
||||
var parent = page.categories.filter(c => !c.parent)
|
||||
if (Array.isArray(page.category_bar)) {
|
||||
parent = page.categories.filter(cat => page.category_bar.indexOf(cat.name) !== -1)
|
||||
}
|
||||
var filterIds = page.categories.map(c => c._id)
|
||||
filterIds.push(page._id)
|
||||
%>
|
||||
|
||||
<%- partial('_partials/category-list', {
|
||||
curCats : parent,
|
||||
params: {
|
||||
type : 'post',
|
||||
filterIds: filterIds,
|
||||
postLimit: theme.post.category_bar.post_limit,
|
||||
postOrderBy: theme.post.category_bar.post_order_by || config.index_generator.order_by
|
||||
}
|
||||
}) %>
|
||||
64
themes/fluid/layout/_partials/post/copyright.ejs
Normal file
64
themes/fluid/layout/_partials/post/copyright.ejs
Normal file
@ -0,0 +1,64 @@
|
||||
<% if (theme.post.copyright.enable && page.copyright !== false) { %>
|
||||
<%
|
||||
var license = theme.post.copyright.license || ''
|
||||
if (typeof page.copyright === 'string') {
|
||||
license = page.copyright
|
||||
} else if (typeof page.license === 'string') {
|
||||
license = page.license
|
||||
}
|
||||
license = license.toUpperCase()
|
||||
%>
|
||||
|
||||
<div class="license-box my-3">
|
||||
<div class="license-title">
|
||||
<div><%= page.title %></div>
|
||||
<div><%= decode_url(page.permalink) %></div>
|
||||
</div>
|
||||
<div class="license-meta">
|
||||
<% if (theme.post.copyright.author.enable && (page.author || config.author)) { %>
|
||||
<div class="license-meta-item">
|
||||
<div><%- __('post.copyright.author') %></div>
|
||||
<div><%- page.author || config.author %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.post.copyright.post_date.enable && page.date) { %>
|
||||
<div class="license-meta-item license-meta-date">
|
||||
<div><%- __('post.copyright.posted') %></div>
|
||||
<div><%= full_date(page.date, theme.post.copyright.post_date.format || 'LL') %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (theme.post.copyright.update_date.enable && page.updated && compare_date(page.date, page.updated)) { %>
|
||||
<div class="license-meta-item license-meta-date">
|
||||
<div><%- __('post.copyright.updated') %></div>
|
||||
<div><%= full_date(page.updated, theme.post.copyright.update_date.format || 'LL') %></div>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (license) { %>
|
||||
<div class="license-meta-item">
|
||||
<div><%- __('post.copyright.licensed') %></div>
|
||||
<div>
|
||||
<% if (['BY', 'BY-SA', 'BY-ND', 'BY-NC', 'BY-NC-SA', 'BY-NC-ND'].indexOf(license) !== -1) { %>
|
||||
<% var items = license.split('-') %>
|
||||
<% for (var idx = 0; idx < items.length; idx++) { %>
|
||||
<a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/<%= license.toLowerCase() %>/4.0/">
|
||||
<span class="hint--top hint--rounded" aria-label="<%- __('post.copyright.' + items[idx]) %>">
|
||||
<i class="iconfont icon-cc-<%= items[idx].toLowerCase() %>"></i>
|
||||
</span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% } else if (license === 'ZERO') { %>
|
||||
<a class="print-no-link" target="_blank" href="https://creativecommons.org/publicdomain/zero/1.0/">
|
||||
<span class="hint--top hint--rounded" aria-label="<%- __('post.copyright.ZERO') %>">
|
||||
<i class="iconfont icon-cc-zero"></i>
|
||||
</span>
|
||||
</a>
|
||||
<% } else { %>
|
||||
<%- license %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="license-icon iconfont"></div>
|
||||
</div>
|
||||
<% } %>
|
||||
16
themes/fluid/layout/_partials/post/meta-bottom.ejs
Normal file
16
themes/fluid/layout/_partials/post/meta-bottom.ejs
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="post-metas my-3">
|
||||
<% if (page.categories && page.categories.length > 0) { %>
|
||||
<div class="post-meta mr-3 d-flex align-items-center">
|
||||
<i class="iconfont icon-category"></i>
|
||||
<%- partial('_partials/category-chains', { categories: page.categories }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (page.tags && page.tags.length > 0 ) { %>
|
||||
<div class="post-meta">
|
||||
<i class="iconfont icon-tags"></i>
|
||||
<% page.tags.each(function(tag) { %>
|
||||
<a href="<%= url_for(tag.path) %>" class="print-no-link">#<%- tag.name %></a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
71
themes/fluid/layout/_partials/post/meta-top.ejs
Normal file
71
themes/fluid/layout/_partials/post/meta-top.ejs
Normal file
@ -0,0 +1,71 @@
|
||||
<% if (page.meta !== false) { %>
|
||||
<div class="mt-3">
|
||||
<% if (theme.post.meta.author && theme.post.meta.author.enable && (page.author || config.author)) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-author" aria-hidden="true"></i>
|
||||
<%- page.author || config.author %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (theme.post.meta.date.enable) { %>
|
||||
<span class="post-meta">
|
||||
<i class="iconfont icon-date-fill" aria-hidden="true"></i>
|
||||
<time datetime="<%= full_date(page.date, 'YYYY-MM-DD HH:mm') %>" pubdate>
|
||||
<%= full_date(page.date, theme.post.meta.date.format) %>
|
||||
</time>
|
||||
</span>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<div class="mt-1">
|
||||
<% if (theme.post.meta.wordcount.enable) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-chart"></i>
|
||||
<% if (theme.post.meta.wordcount.format) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.meta.wordcount.format.replace('{}', wordcount(page)) %>
|
||||
<% } else { %>
|
||||
<%- __('post.meta.wordcount', wordcount(page)) %>
|
||||
<% } %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.post.meta.min2read.enable) { %>
|
||||
<span class="post-meta mr-2">
|
||||
<i class="iconfont icon-clock-fill"></i>
|
||||
<% var awl = parseInt(theme.post.meta.min2read.awl, 10) %>
|
||||
<% var wpm = parseInt(theme.post.meta.min2read.wpm, 10) %>
|
||||
<% if (theme.post.meta.min2read.format) { %>
|
||||
<!-- compatible with older versions-->
|
||||
<%- theme.post.meta.min2read.format.replace('{}', min2read(page, { awl: awl, wpm: wpm })) %>
|
||||
<% } else { %>
|
||||
<%- __('post.meta.min2read', min2read(page, { awl: awl, wpm: wpm })) %>
|
||||
<% } %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% var views_texts = (theme.post.meta.views.format || __('post.meta.views')).split('{}') %>
|
||||
<% if (theme.post.meta.views.enable && views_texts.length >= 2) { %>
|
||||
<% if (theme.post.meta.views.source === 'leancloud') { %>
|
||||
<span id="leancloud-page-views-container" class="post-meta" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="leancloud-page-views"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.post.meta.views.source === 'busuanzi') { %>
|
||||
<span id="busuanzi_container_page_pv" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="busuanzi_value_page_pv"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
|
||||
|
||||
<% } else if (theme.post.meta.views.source === 'umami') { %>
|
||||
<span id="umami-page-views-container" class="post-meta" style="display: none">
|
||||
<i class="iconfont icon-eye" aria-hidden="true"></i>
|
||||
<%- views_texts[0] %><span id="umami-page-views"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% import_js(theme.static_prefix.internal_js, 'umami-view.js', 'defer') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/post/sidebar-left.ejs
Normal file
10
themes/fluid/layout/_partials/post/sidebar-left.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if(theme.post.toc.enable && theme.post.toc.placement === 'left' && page.toc !== false){ %>
|
||||
<aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
|
||||
<%- partial('_partials/post/toc') %>
|
||||
</aside>
|
||||
<% } else if (theme.post.category_bar.enable && theme.post.category_bar.placement !== 'right' && !page.hide &&
|
||||
(!theme.post.category_bar.specific || (theme.post.category_bar.specific && page.category_bar))) { %>
|
||||
<aside class="sidebar category-bar" style="margin-right: -1rem">
|
||||
<%- partial('_partials/post/category-bar') %>
|
||||
</aside>
|
||||
<% } %>
|
||||
10
themes/fluid/layout/_partials/post/sidebar-right.ejs
Normal file
10
themes/fluid/layout/_partials/post/sidebar-right.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<% if(theme.post.toc.enable && theme.post.toc.placement !== 'left' && page.toc !== false){ %>
|
||||
<aside class="sidebar" style="margin-left: -1rem">
|
||||
<%- partial('_partials/post/toc') %>
|
||||
</aside>
|
||||
<% } else if (theme.post.category_bar.enable && theme.post.category_bar.placement === 'right' && !page.hide &&
|
||||
(!theme.post.category_bar.specific || (theme.post.category_bar.specific && page.category_bar))) { %>
|
||||
<aside class="sidebar category-bar" style="margin-left: -1rem">
|
||||
<%- partial('_partials/post/category-bar') %>
|
||||
</aside>
|
||||
<% } %>
|
||||
49
themes/fluid/layout/_partials/post/toc.ejs
Normal file
49
themes/fluid/layout/_partials/post/toc.ejs
Normal file
@ -0,0 +1,49 @@
|
||||
<div id="toc">
|
||||
<p class="toc-header">
|
||||
<i class="iconfont icon-list"></i>
|
||||
<span><%- __('post.toc') %></span>
|
||||
</p>
|
||||
<div class="toc-body" id="toc-body"></div>
|
||||
</div>
|
||||
|
||||
<%
|
||||
import_script(`
|
||||
<script>
|
||||
Fluid.utils.createScript('${url_join(theme.static_prefix.tocbot, 'tocbot.min.js')}', function() {
|
||||
var toc = jQuery('#toc');
|
||||
if (toc.length === 0 || !window.tocbot) { return; }
|
||||
var boardCtn = jQuery('#board-ctn');
|
||||
var boardTop = boardCtn.offset().top;
|
||||
|
||||
window.tocbot.init(Object.assign({
|
||||
tocSelector : '#toc-body',
|
||||
contentSelector : '.markdown-body',
|
||||
linkClass : 'tocbot-link',
|
||||
activeLinkClass : 'tocbot-active-link',
|
||||
listClass : 'tocbot-list',
|
||||
isCollapsedClass: 'tocbot-is-collapsed',
|
||||
collapsibleClass: 'tocbot-is-collapsible',
|
||||
scrollSmooth : true,
|
||||
includeTitleTags: true,
|
||||
headingsOffset : -boardTop,
|
||||
}, CONFIG.toc));
|
||||
if (toc.find('.toc-list-item').length > 0) {
|
||||
toc.css('visibility', 'visible');
|
||||
}
|
||||
|
||||
Fluid.events.registerRefreshCallback(function() {
|
||||
if ('tocbot' in window) {
|
||||
tocbot.refresh();
|
||||
var toc = jQuery('#toc');
|
||||
if (toc.length === 0 || !tocbot) {
|
||||
return;
|
||||
}
|
||||
if (toc.find('.toc-list-item').length > 0) {
|
||||
toc.css('visibility', 'visible');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
`)
|
||||
%>
|
||||
31
themes/fluid/layout/_partials/scripts.ejs
Normal file
31
themes/fluid/layout/_partials/scripts.ejs
Normal file
@ -0,0 +1,31 @@
|
||||
<%- partial('_partials/plugins/nprogress.ejs') %>
|
||||
<%- js_ex(theme.static_prefix.jquery, 'jquery.min.js') %>
|
||||
<%- js_ex(theme.static_prefix.bootstrap, 'js/bootstrap.min.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'events.js') %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'plugins.js') %>
|
||||
|
||||
<%- partial('_partials/plugins/typed.ejs') %>
|
||||
|
||||
<% if (theme.lazyload.enable){ %>
|
||||
<% if (theme.lazyload.onlypost) { %>
|
||||
<% if (is_post() || is_page()) { %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'img-lazyload.js') %>
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'img-lazyload.js') %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
||||
<% var script_snippets = deduplicate(page.script_snippets) %>
|
||||
<% for (var idx = 0; idx < script_snippets.length; idx++) { %>
|
||||
<%- script_snippets[idx] %>
|
||||
<% } %>
|
||||
<% page.script_snippets = [] %>
|
||||
|
||||
<% if (theme.custom_js) { %>
|
||||
<%- js(theme.custom_js) %>
|
||||
<% } %>
|
||||
|
||||
<!-- 主题的启动项,将它保持在最底部 -->
|
||||
<!-- the boot of the theme, keep it at the bottom -->
|
||||
<%- js_ex(theme.static_prefix.internal_js, 'boot.js') %>
|
||||
20
themes/fluid/layout/_partials/search.ejs
Normal file
20
themes/fluid/layout/_partials/search.ejs
Normal file
@ -0,0 +1,20 @@
|
||||
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<h4 class="modal-title w-100 font-weight-bold"><%= __('search.title') %></h4>
|
||||
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mx-3">
|
||||
<div class="md-form mb-5">
|
||||
<input type="text" id="local-search-input" class="form-control validate">
|
||||
<label data-error="x" data-success="v" for="local-search-input"><%= __('search.keyword') %></label>
|
||||
</div>
|
||||
<div class="list-group" id="local-search-result"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user