2025-2-26-fixed
This commit is contained in:
83
themes/next/layout/_partials/comments.swig
Normal file
83
themes/next/layout/_partials/comments.swig
Normal file
@ -0,0 +1,83 @@
|
||||
{%- if page.comments %}
|
||||
{%- if theme.injects.comment.length == 1 %}
|
||||
{%- set inject_item = theme.injects.comment[0] %}
|
||||
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
|
||||
{%- elif theme.injects.comment.length > 1 %}
|
||||
{%- if theme.comments.style == 'buttons' %}
|
||||
<div class="comment-button-group">
|
||||
{%- for inject_item in theme.injects.comment %}
|
||||
<a class="btn comment-button {{ inject_item.locals.class }}">{{ inject_item.locals.button }}</a>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
{%- for inject_item in theme.injects.comment %}
|
||||
<div class="comment-position {{ inject_item.locals.class }}">
|
||||
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
|
||||
</div>
|
||||
{%- endfor %}
|
||||
<script{{ pjax }}>
|
||||
(function() {
|
||||
let commentButton = document.querySelectorAll('.comment-button');
|
||||
commentButton.forEach(element => {
|
||||
let commentClass = element.classList[2];
|
||||
element.addEventListener('click', () => {
|
||||
commentButton.forEach(rmActive => rmActive.classList.remove('active'));
|
||||
element.classList.add('active');
|
||||
document.querySelectorAll('.comment-position').forEach(rmActive => rmActive.classList.remove('active'));
|
||||
document.querySelector(`.comment-position.${commentClass}`).classList.add('active');
|
||||
if (CONFIG.comments.storage) {
|
||||
localStorage.setItem('comments_active', commentClass);
|
||||
}
|
||||
});
|
||||
});
|
||||
let { activeClass } = CONFIG.comments;
|
||||
if (CONFIG.comments.storage) {
|
||||
activeClass = localStorage.getItem('comments_active') || activeClass;
|
||||
}
|
||||
if (activeClass) {
|
||||
let activeButton = document.querySelector(`.comment-button.${activeClass}`);
|
||||
if (activeButton) {
|
||||
activeButton.click();
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{%- elif theme.comments.style == 'tabs' %}
|
||||
<div class="tabs tabs-comment">
|
||||
<ul class="nav-tabs">
|
||||
{%- for inject_item in theme.injects.comment %}
|
||||
<li class="tab"><a href="#comment-{{ inject_item.locals.class }}">{{ inject_item.locals.button }}</a></li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{%- for inject_item in theme.injects.comment %}
|
||||
<div class="tab-pane {{ inject_item.locals.class }}" id="comment-{{ inject_item.locals.class }}">
|
||||
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
|
||||
</div>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
<script>
|
||||
window.addEventListener('tabs:register', () => {
|
||||
let { activeClass } = CONFIG.comments;
|
||||
if (CONFIG.comments.storage) {
|
||||
activeClass = localStorage.getItem('comments_active') || activeClass;
|
||||
}
|
||||
if (activeClass) {
|
||||
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
|
||||
if (activeTab) {
|
||||
activeTab.click();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (CONFIG.comments.storage) {
|
||||
window.addEventListener('tabs:click', event => {
|
||||
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
|
||||
let commentClass = event.target.classList[1];
|
||||
localStorage.setItem('comments_active', commentClass);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
61
themes/next/layout/_partials/footer.swig
Normal file
61
themes/next/layout/_partials/footer.swig
Normal file
@ -0,0 +1,61 @@
|
||||
{%- if theme.footer.beian.enable %}
|
||||
<div class="beian">
|
||||
{{- next_url('https://beian.miit.gov.cn', theme.footer.beian.icp + ' ') }}
|
||||
{%- if theme.footer.beian.gongan_icon_url %}
|
||||
<img src="{{ url_for(theme.footer.beian.gongan_icon_url) }}" style="display: inline-block;">
|
||||
{%- endif %}
|
||||
{%- if theme.footer.beian.gongan_id and theme.footer.beian.gongan_num %}
|
||||
{{- next_url('http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=' + theme.footer.beian.gongan_id, theme.footer.beian.gongan_num + ' ') }}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
<div class="copyright">
|
||||
{% set copyright_year = date(null, 'YYYY') %}
|
||||
© {% if theme.footer.since and theme.footer.since != copyright_year %}{{ theme.footer.since }} – {% endif %}
|
||||
<span itemprop="copyrightYear">{{ copyright_year }}</span>
|
||||
<span class="with-love">
|
||||
<i class="{{ theme.footer.icon.name }}"></i>
|
||||
</span>
|
||||
<span class="author" itemprop="copyrightHolder">{{ theme.footer.copyright or author }}</span>
|
||||
|
||||
{%- if config.symbols_count_time.total_symbols %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-chart-area"></i>
|
||||
</span>
|
||||
{%- if theme.symbols_count_time.item_text_total %}
|
||||
<span class="post-meta-item-text">{{ __('symbols_count_time.count_total') + __('symbol.colon') }}</span>
|
||||
{%- endif %}
|
||||
<span title="{{ __('symbols_count_time.count_total') }}">{{ symbolsCountTotal(site) }}</span>
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.symbols_count_time.total_time %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
<span class="post-meta-item-icon">
|
||||
<i class="fa fa-coffee"></i>
|
||||
</span>
|
||||
{%- if theme.symbols_count_time.item_text_total %}
|
||||
<span class="post-meta-item-text">{{ __('symbols_count_time.time_total') }} ≈</span>
|
||||
{%- endif %}
|
||||
<span title="{{ __('symbols_count_time.time_total') }}">{{ symbolsTimeTotal(site, config.symbols_count_time.awl, config.symbols_count_time.wpm, __('symbols_count_time.time_minutes')) }}</span>
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
{%- if theme.footer.powered %}
|
||||
<div class="powered-by">
|
||||
{%- set next_site = 'https://theme-next.org' %}
|
||||
{%- if theme.scheme !== 'Gemini' %}
|
||||
{%- set next_site = 'https://' + theme.scheme | lower + '.theme-next.org' %}
|
||||
{%- endif %}
|
||||
{{- __('footer.powered', next_url('https://hexo.io', 'Hexo', {class: 'theme-link'}) + ' & ' + next_url(next_site, 'NexT.' + theme.scheme, {class: 'theme-link'})) }}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.add_this_id %}
|
||||
<div class="addthis_inline_share_toolbox">
|
||||
<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ theme.add_this_id }}" async="async"></script>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{{- next_inject('footer') }}
|
||||
14
themes/next/layout/_partials/head/head-unique.swig
Normal file
14
themes/next/layout/_partials/head/head-unique.swig
Normal file
@ -0,0 +1,14 @@
|
||||
{{ open_graph() }}
|
||||
|
||||
{{ canonical() }}
|
||||
|
||||
{# Exports some front-matter variables to Front-End #}
|
||||
<script id="page-configurations">
|
||||
// https://hexo.io/docs/variables.html
|
||||
CONFIG.page = {
|
||||
sidebar: {{ page.sidebar | json }},
|
||||
isHome : {{ is_home() }},
|
||||
isPost : {{ is_post() }},
|
||||
lang : '{{ page.lang }}'
|
||||
};
|
||||
</script>
|
||||
61
themes/next/layout/_partials/head/head.swig
Normal file
61
themes/next/layout/_partials/head/head.swig
Normal file
@ -0,0 +1,61 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
|
||||
<meta name="theme-color" content="{{ theme.android_chrome_color }}">
|
||||
<meta name="generator" content="Hexo {{ hexo_version }}">
|
||||
|
||||
{%- if theme.favicon.apple_touch_icon %}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for(theme.favicon.apple_touch_icon) }}">
|
||||
{%- endif %}
|
||||
{%- if theme.favicon.medium %}
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for(theme.favicon.medium) }}">
|
||||
{%- endif %}
|
||||
{%- if theme.favicon.small %}
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for(theme.favicon.small) }}">
|
||||
{%- endif %}
|
||||
{%- if theme.favicon.safari_pinned_tab %}
|
||||
<link rel="mask-icon" href="{{ url_for(theme.favicon.safari_pinned_tab) }}" color="{{ theme.android_chrome_color }}">
|
||||
{%- endif %}
|
||||
{%- if theme.favicon.android_manifest %}
|
||||
<link rel="manifest" href="{{ url_for(theme.favicon.android_manifest) }}">
|
||||
{%- endif %}
|
||||
{%- if theme.favicon.ms_browserconfig %}
|
||||
<meta name="msapplication-config" content="{{ url_for(theme.favicon.ms_browserconfig) }}">
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.disable_baidu_transformation %}
|
||||
<meta http-equiv="Cache-Control" content="no-transform">
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp">
|
||||
{%- endif %}
|
||||
{%- if theme.google_site_verification %}
|
||||
<meta name="google-site-verification" content="{{ theme.google_site_verification }}">
|
||||
{%- endif %}
|
||||
{%- if theme.bing_site_verification %}
|
||||
<meta name="msvalidate.01" content="{{ theme.bing_site_verification }}">
|
||||
{%- endif %}
|
||||
{%- if theme.yandex_site_verification %}
|
||||
<meta name="yandex-verification" content="{{ theme.yandex_site_verification }}">
|
||||
{%- endif %}
|
||||
{%- if theme.baidu_site_verification %}
|
||||
<meta name="baidu-site-verification" content="{{ theme.baidu_site_verification }}">
|
||||
{%- endif %}
|
||||
|
||||
<link rel="stylesheet" href="{{ url_for(theme.css) }}/main.css">
|
||||
|
||||
{{ next_font() }}
|
||||
|
||||
{%- set font_awesome_uri = theme.vendors.fontawesome or next_vendors('font-awesome/css/all.min.css') %}
|
||||
<link rel="stylesheet" href="{{ font_awesome_uri }}">
|
||||
|
||||
{%- if theme.fancybox %}
|
||||
{%- set fancybox_css_uri = theme.vendors.fancybox_css or next_vendors('//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css') %}
|
||||
<link rel="stylesheet" href="{{ fancybox_css_uri }}">
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.pace.enable %}
|
||||
{%- set pace_css_uri = theme.vendors.pace_css or next_vendors('pace/pace-theme-' + theme.pace.theme + '.min.css') %}
|
||||
{%- set pace_js_uri = theme.vendors.pace or next_vendors('pace/pace.min.js') %}
|
||||
<link rel="stylesheet" href="{{ pace_css_uri }}">
|
||||
<script src="{{ pace_js_uri }}"></script>
|
||||
{%- endif %}
|
||||
|
||||
{{ next_config() }}
|
||||
41
themes/next/layout/_partials/header/brand.swig
Normal file
41
themes/next/layout/_partials/header/brand.swig
Normal file
@ -0,0 +1,41 @@
|
||||
<div class="site-brand-container">
|
||||
<div class="site-nav-toggle">
|
||||
<div class="toggle" aria-label="{{ __('accessibility.nav_toggle') }}">
|
||||
<span class="toggle-line toggle-line-first"></span>
|
||||
<span class="toggle-line toggle-line-middle"></span>
|
||||
<span class="toggle-line toggle-line-last"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="site-meta{%- if theme.custom_logo %} custom-logo{%- endif %}">
|
||||
{%- if theme.custom_logo and theme.scheme === 'Muse' %}
|
||||
<div class="site-meta-headline">
|
||||
<a>
|
||||
<img class="custom-logo-image" src="{{ theme.custom_logo }}" alt="{{ title }}">
|
||||
</a>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
<a href="{{ config.root }}" class="brand" rel="start">
|
||||
<span class="logo-line-before"><i></i></span>
|
||||
<h1 class="site-title">{{ title }}</h1>
|
||||
<span class="logo-line-after"><i></i></span>
|
||||
</a>
|
||||
{%- if subtitle %}
|
||||
<p class="site-subtitle" itemprop="description">{{ subtitle }}</p>
|
||||
{%- endif %}
|
||||
{%- if theme.custom_logo and (theme.scheme === 'Gemini' or theme.scheme === 'Pisces') %}
|
||||
<a>
|
||||
<img class="custom-logo-image" src="{{ theme.custom_logo }}" alt="{{ title }}">
|
||||
</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
<div class="site-nav-right">
|
||||
<div class="toggle popup-trigger">
|
||||
{%- if theme.algolia_search.enable or theme.local_search.enable %}
|
||||
<i class="fa fa-search fa-fw fa-lg"></i>
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
7
themes/next/layout/_partials/header/index.swig
Normal file
7
themes/next/layout/_partials/header/index.swig
Normal file
@ -0,0 +1,7 @@
|
||||
{{ partial('_partials/header/brand.swig', {}, {cache: theme.cache.enable}) }}
|
||||
|
||||
{{ partial('_partials/header/menu.swig', {}, {cache: theme.cache.enable}) }}
|
||||
|
||||
{{ partial('_partials/search/index.swig', {}, {cache: theme.cache.enable}) }}
|
||||
|
||||
{{- next_inject('header') }}
|
||||
34
themes/next/layout/_partials/header/menu-item.swig
Normal file
34
themes/next/layout/_partials/header/menu-item.swig
Normal file
@ -0,0 +1,34 @@
|
||||
{% macro render(name, itemName, value) %}
|
||||
|
||||
{%- set itemURL = value.split('||')[0] | trim %}
|
||||
{%- if not itemURL.startsWith('http') %}
|
||||
{%- set itemURL = itemURL | replace('//', '/') %}
|
||||
{%- endif %}
|
||||
<li class="menu-item menu-item-{{ itemName | replace(' ', '-') }}">
|
||||
|
||||
{%- set menuIcon = '' %}
|
||||
{%- if theme.menu_settings.icons %}
|
||||
{%- set menuIcon = '<i class="' + value.split('||')[1] | trim + ' fa-fw"></i>' %}
|
||||
{%- endif %}
|
||||
{%- set menuText = __('menu.' + name) | replace('menu.', '') %}
|
||||
|
||||
{%- set menuBadge = '' %}
|
||||
{%- if theme.menu_settings.badges %}
|
||||
{%- set badges = {
|
||||
archives : site.posts.length,
|
||||
categories: site.categories.length,
|
||||
tags : site.tags.length
|
||||
}
|
||||
%}
|
||||
{%- for menu, count in badges %}
|
||||
{%- if name == menu %}
|
||||
{%- set menuBadge = '<span class="badge">' + count + '</span>' %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
{{ next_url(itemURL, menuIcon + menuText + menuBadge, {rel: 'section'}) }}
|
||||
|
||||
</li>
|
||||
|
||||
{% endmacro %}
|
||||
34
themes/next/layout/_partials/header/menu.swig
Normal file
34
themes/next/layout/_partials/header/menu.swig
Normal file
@ -0,0 +1,34 @@
|
||||
{% import 'menu-item.swig' as menu_item with context %}
|
||||
|
||||
<nav class="site-nav">
|
||||
{%- if theme.menu %}
|
||||
<ul id="menu" class="main-menu menu">
|
||||
{%- for name, path in theme.menu %}
|
||||
{%- set respath = path %}
|
||||
{%- if path == '[object Object]' %}
|
||||
{# Main Menu (default menu item for Submenu) #}
|
||||
{%- for subname, subpath in path %}
|
||||
{%- set itemName = subname | lower %}
|
||||
{%- set respath = subpath %}
|
||||
{%- if itemName == 'default' %}
|
||||
{%- set itemName = name | lower %}
|
||||
{{ menu_item.render(name, itemName, respath) }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{% else %}
|
||||
{# Main Menu (standard menu items) #}
|
||||
{%- set itemName = name | lower %}
|
||||
{{- menu_item.render(name, itemName, respath) | trim }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{%- if theme.algolia_search.enable or theme.local_search.enable %}
|
||||
<li class="menu-item menu-item-search">
|
||||
<a role="button" class="popup-trigger">
|
||||
{%- if theme.menu_settings.icons %}<i class="fa fa-search fa-fw"></i>{%- endif %}{{ __('menu.search') }}
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
</nav>
|
||||
96
themes/next/layout/_partials/header/sub-menu.swig
Normal file
96
themes/next/layout/_partials/header/sub-menu.swig
Normal file
@ -0,0 +1,96 @@
|
||||
{% import '_partials/header/menu-item.swig' as menu_item with context %}
|
||||
|
||||
{%- if theme.menu and is_page() %}
|
||||
{# Submenu & Submenu-2 #}
|
||||
{%- for name, value in theme.menu %}
|
||||
{%- set respath = value %}
|
||||
{%- if value == '[object Object]' %}
|
||||
|
||||
{# If current URL is value of parent submenu 'default' path #}
|
||||
{%- set currentParentUrl = page.path.split('/')[0] | trim %}
|
||||
{%- if currentParentUrl == value.default.split('||')[0] | trim | replace('/', '') %}
|
||||
|
||||
{# Submenu items #}
|
||||
<ul id="sub-menu" class="sub-menu menu">
|
||||
{%- for subname, subvalue in value %}
|
||||
{# For main submenu items #}
|
||||
{%- if subvalue != '[object Object]' %}
|
||||
{%- set itemName = subname | lower %}
|
||||
{%- if itemName == 'default' %}
|
||||
{%- set parentValue = subvalue.split('||')[0] | trim %}
|
||||
{% else %}
|
||||
{%- if subvalue.startsWith('http') %}
|
||||
{%- set respath = subvalue %}
|
||||
{% else %}
|
||||
{%- set respath = parentValue + subvalue %}
|
||||
{%- endif %}
|
||||
{{ menu_item.render(subname, itemName, respath) }}
|
||||
{%- endif %}
|
||||
{% else %}
|
||||
{# For 'default' submenu item in main submenu #}
|
||||
{%- set itemName = subname | lower %}
|
||||
{%- for subname2, subvalue2 in subvalue %}
|
||||
{%- if subname2 == 'default' %}
|
||||
{%- set respath = parentValue + subvalue2 %}
|
||||
{{ menu_item.render(subname, itemName, respath) }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{# End Submenu items #}
|
||||
|
||||
{# Submenu-2 #}
|
||||
{%- for name, value in theme.menu %}
|
||||
{%- set respath = value %}
|
||||
{%- if value == '[object Object]' %}
|
||||
|
||||
{%- for subname, subvalue in value %}
|
||||
{%- set itemName = subname | lower %}
|
||||
{%- if itemName == 'default' %}
|
||||
{%- set parentValue = subvalue.split('||')[0] | trim %}
|
||||
{%- endif %}
|
||||
{%- if subvalue == '[object Object]' %}
|
||||
|
||||
{# If current URL is value of parent submenu 'default' path #}
|
||||
{%- set paths = page.path.split('/') %}
|
||||
{%- if paths.length > 2 %}
|
||||
{%- if paths[1] == subvalue.default.split('||')[0] | trim | replace('/', '') %}
|
||||
|
||||
{# Submenu-2 items #}
|
||||
<ul id="sub-menu-2" class="sub-menu menu">
|
||||
{%- for subname2, subvalue2 in subvalue %}
|
||||
{%- set respath2 = subvalue %}
|
||||
{%- set itemName = subname2 | lower %}
|
||||
{%- if itemName == 'default' %}
|
||||
{%- set parentSubValue = subvalue2.split('||')[0] | trim %}
|
||||
{% else %}
|
||||
{%- if subvalue2.startsWith('http') %}
|
||||
{%- set respath2 = subvalue2 %}
|
||||
{% else %}
|
||||
{%- set respath2 = parentValue + parentSubValue + subvalue2 %}
|
||||
{%- endif %}
|
||||
{{ menu_item.render(subname2, itemName, respath2) }}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{# End Submenu-2 items #}
|
||||
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{# End URL & path comparing #}
|
||||
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{# End Submenu-2 #}
|
||||
|
||||
{%- endif %}
|
||||
{# End URL & path comparing #}
|
||||
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{# End Submenu & Submenu-2 #}
|
||||
{%- endif %}
|
||||
16
themes/next/layout/_partials/languages.swig
Normal file
16
themes/next/layout/_partials/languages.swig
Normal file
@ -0,0 +1,16 @@
|
||||
{%- if theme.language_switcher and languages.length > 1 %}
|
||||
<div class="languages">
|
||||
<label class="lang-select-label">
|
||||
<i class="fa fa-language"></i>
|
||||
<span>{{ language_name(page.lang) }}</span>
|
||||
<i class="fa fa-angle-up" aria-hidden="true"></i>
|
||||
</label>
|
||||
<select class="lang-select" data-canonical="">
|
||||
{% for language in languages %}
|
||||
<option value="{{ language }}" data-href="{{ i18n_path(language) }}" selected="">
|
||||
{{ language_name(language) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{%- endif %}
|
||||
27
themes/next/layout/_partials/page/breadcrumb.swig
Normal file
27
themes/next/layout/_partials/page/breadcrumb.swig
Normal file
@ -0,0 +1,27 @@
|
||||
{%- set paths = page.path.split('/') %}
|
||||
{%- set count = paths.length %}
|
||||
{%- if count > 2 %}
|
||||
{%- set current = 0 %}
|
||||
{%- set link = '' %}
|
||||
<ul class="breadcrumb">
|
||||
{%- for path in paths %}
|
||||
{%- set current = current + 1 %}
|
||||
{%- if path != 'index.html' %}
|
||||
{%- if current == count - 1 and paths[count - 1] == 'index.html' %}
|
||||
<li>{{ path | upper }}</li>
|
||||
{% else %}
|
||||
{%- if link == '' %}
|
||||
{%- set link = '/' + path %}
|
||||
{% else %}
|
||||
{%- set link = link + '/' + path %}
|
||||
{%- endif %}
|
||||
{%- if path.includes('.html') %}
|
||||
<li>{{ path | replace('.html', '') | upper }}</li>
|
||||
{% else %}
|
||||
<li><a href="{{ url_for(link) }}/">{{ path | upper }}</a></li>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
15
themes/next/layout/_partials/page/page-header.swig
Normal file
15
themes/next/layout/_partials/page/page-header.swig
Normal file
@ -0,0 +1,15 @@
|
||||
<header class="post-header">
|
||||
|
||||
<h1 class="post-title" itemprop="name headline">
|
||||
{{- page.title }}
|
||||
{{- post_edit(page.source) }}
|
||||
</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
{%- if page.description %}
|
||||
<div class="post-description">{{ page.description }}</div>
|
||||
{%- endif %}
|
||||
{% include '_partials/page/breadcrumb.swig' %}
|
||||
</div>
|
||||
|
||||
</header>
|
||||
12
themes/next/layout/_partials/pagination.swig
Normal file
12
themes/next/layout/_partials/pagination.swig
Normal file
@ -0,0 +1,12 @@
|
||||
{%- if page.prev or page.next %}
|
||||
<nav class="pagination">
|
||||
{{
|
||||
paginator({
|
||||
prev_text: '<i class="fa fa-angle-left" aria-label="' + __('accessibility.prev_page') + '"></i>',
|
||||
next_text: '<i class="fa fa-angle-right" aria-label="' + __('accessibility.next_page') + '"></i>',
|
||||
mid_size : 1,
|
||||
escape : false
|
||||
})
|
||||
}}
|
||||
</nav>
|
||||
{%- endif %}
|
||||
19
themes/next/layout/_partials/post/post-copyright.swig
Normal file
19
themes/next/layout/_partials/post/post-copyright.swig
Normal file
@ -0,0 +1,19 @@
|
||||
{%- set ccIcon = '<i class="fab fa-fw fa-creative-commons"></i>' %}
|
||||
{%- set ccText = theme.creative_commons.license | upper %}
|
||||
|
||||
<div>
|
||||
<ul class="post-copyright">
|
||||
<li class="post-copyright-author">
|
||||
<strong>{{ __('post.copyright.author') + __('symbol.colon') }} </strong>
|
||||
{{- page.author or author }}
|
||||
</li>
|
||||
<li class="post-copyright-link">
|
||||
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
|
||||
{{ next_url(page.permalink, page.permalink, {title: page.title}) }}
|
||||
</li>
|
||||
<li class="post-copyright-license">
|
||||
<strong>{{ __('post.copyright.license_title') + __('symbol.colon') }} </strong>
|
||||
{{- __('post.copyright.license_content', next_url(ccURL, ccIcon + ccText)) }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
23
themes/next/layout/_partials/post/post-followme.swig
Normal file
23
themes/next/layout/_partials/post/post-followme.swig
Normal file
@ -0,0 +1,23 @@
|
||||
{%- if theme.follow_me %}
|
||||
|
||||
<div class="followme">
|
||||
<p>{{ __('follow_me.welcome') }}</p>
|
||||
|
||||
<div class="social-list">
|
||||
{%- for name, value in theme.follow_me %}
|
||||
{%- set link = value.split('||')[0] | trim %}
|
||||
{%- set icon = value.split('||')[1] | trim %}
|
||||
|
||||
<div class="social-item">
|
||||
<a target="_blank" class="social-link" href="{{ link }}">
|
||||
<span class="icon">
|
||||
<i class="{{ icon }}"></i>
|
||||
</span>
|
||||
|
||||
<span class="label">{{ name }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
7
themes/next/layout/_partials/post/post-footer.swig
Normal file
7
themes/next/layout/_partials/post/post-footer.swig
Normal file
@ -0,0 +1,7 @@
|
||||
{%- if theme.rating.enable %}
|
||||
<div class="post-widgets">
|
||||
<div class="wp_rating">
|
||||
<div id="wpac-rating"></div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
20
themes/next/layout/_partials/post/post-related.swig
Normal file
20
themes/next/layout/_partials/post/post-related.swig
Normal file
@ -0,0 +1,20 @@
|
||||
{%- set popular_posts = popular_posts_json(theme.related_posts.params, page) %}
|
||||
{%- if popular_posts.json and popular_posts.json.length > 0 %}
|
||||
<div class="popular-posts-header">{{ theme.related_posts.title or __('post.related_posts') }}</div>
|
||||
<ul class="popular-posts">
|
||||
{%- for popular_post in popular_posts.json %}
|
||||
<li class="popular-posts-item">
|
||||
{%- if popular_post.date and popular_post.date != '' %}
|
||||
<div class="popular-posts-date">{{ popular_post.date }}</div>
|
||||
{%- endif %}
|
||||
{%- if popular_post.img and popular_post.img != '' %}
|
||||
<div class="popular-posts-img"><img src="{{ popular_post.img }}"></div>
|
||||
{%- endif %}
|
||||
<div class="popular-posts-title"><a href="{{ popular_post.path }}" rel="bookmark">{{ popular_post.title }}</a></div>
|
||||
{%- if popular_post.excerpt and popular_post.excerpt != '' %}
|
||||
<div class="popular-posts-excerpt"><p>{{ popular_post.excerpt }}</p></div>
|
||||
{%- endif %}
|
||||
</li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
22
themes/next/layout/_partials/post/post-reward.swig
Normal file
22
themes/next/layout/_partials/post/post-reward.swig
Normal file
@ -0,0 +1,22 @@
|
||||
<div class="reward-container">
|
||||
<div>{{ page.reward_settings.comment }}</div>
|
||||
<button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
|
||||
{{ __('reward.donate') }}
|
||||
</button>
|
||||
<div id="qr" style="display: none;">
|
||||
|
||||
{%- for name, image in theme.reward %}
|
||||
{%- set builtin = ['wechatpay', 'alipay', 'paypal', 'bitcoin'] %}
|
||||
{%- if builtin.includes(name) %}
|
||||
{%- set translation = __('reward.' + name) %}
|
||||
{% else %}
|
||||
{%- set translation = name %}
|
||||
{%- endif %}
|
||||
<div style="display: inline-block;">
|
||||
<img src="{{ url_for(image) }}" alt="{{ author }} {{ translation }}">
|
||||
<p>{{ translation }}</p>
|
||||
</div>
|
||||
{%- endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
14
themes/next/layout/_partials/search/algolia-search.swig
Normal file
14
themes/next/layout/_partials/search/algolia-search.swig
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="search-header">
|
||||
<span class="search-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
<div class="search-input-container"></div>
|
||||
<span class="popup-btn-close">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="algolia-results">
|
||||
<div id="algolia-stats"></div>
|
||||
<div id="algolia-hits"></div>
|
||||
<div id="algolia-pagination" class="algolia-pagination"></div>
|
||||
</div>
|
||||
11
themes/next/layout/_partials/search/index.swig
Normal file
11
themes/next/layout/_partials/search/index.swig
Normal file
@ -0,0 +1,11 @@
|
||||
{%- if theme.algolia_search.enable or theme.local_search.enable %}
|
||||
<div class="search-pop-overlay">
|
||||
<div class="popup search-popup">
|
||||
{%- if theme.algolia_search.enable %}
|
||||
{% include 'algolia-search.swig' %}
|
||||
{% elif theme.local_search.enable %}
|
||||
{% include 'localsearch.swig' %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
18
themes/next/layout/_partials/search/localsearch.swig
Normal file
18
themes/next/layout/_partials/search/localsearch.swig
Normal file
@ -0,0 +1,18 @@
|
||||
<div class="search-header">
|
||||
<span class="search-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
<div class="search-input-container">
|
||||
<input autocomplete="off" autocapitalize="off"
|
||||
placeholder="{{ __('search.placeholder') }}" spellcheck="false"
|
||||
type="search" class="search-input">
|
||||
</div>
|
||||
<span class="popup-btn-close">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div id="search-result">
|
||||
<div id="no-result">
|
||||
<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
|
||||
</div>
|
||||
</div>
|
||||
120
themes/next/layout/_partials/sidebar/site-overview.swig
Normal file
120
themes/next/layout/_partials/sidebar/site-overview.swig
Normal file
@ -0,0 +1,120 @@
|
||||
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
|
||||
{%- if theme.avatar.url %}
|
||||
<img class="site-author-image" itemprop="image" alt="{{ author }}"
|
||||
src="{{ url_for(theme.avatar.url) }}">
|
||||
{%- endif %}
|
||||
<p class="site-author-name" itemprop="name">{{ author }}</p>
|
||||
<div class="site-description" itemprop="description">{{ description }}</div>
|
||||
</div>
|
||||
|
||||
{%- if theme.site_state %}
|
||||
<div class="site-state-wrap motion-element">
|
||||
<nav class="site-state">
|
||||
{%- if config.archive_dir != '/' and site.posts.length > 0 %}
|
||||
<div class="site-state-item site-state-posts">
|
||||
{%- if theme.menu.archives %}
|
||||
<a href="{{ url_for(theme.menu.archives.split('||')[0] | trim) }}">
|
||||
{% else %}
|
||||
<a href="{{ url_for(config.archive_dir) }}">
|
||||
{%- endif %}
|
||||
<span class="site-state-item-count">{{ site.posts.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.posts') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if site.categories.length > 0 %}
|
||||
{%- set categoriesPageQuery = site.pages.find({type: 'categories'}, {lean: true}) %}
|
||||
{%- set hasCategoriesPage = categoriesPageQuery.length > 0 %}
|
||||
<div class="site-state-item site-state-categories">
|
||||
{%- if hasCategoriesPage %}
|
||||
{%- if theme.menu.categories %}
|
||||
<a href="{{ url_for(theme.menu.categories.split('||')[0] | trim) }}">
|
||||
{% else %}
|
||||
<a href="{{ url_for(config.category_dir) + '/' }}">
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
<span class="site-state-item-count">{{ site.categories.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.categories') }}</span>
|
||||
{%- if hasCategoriesPage %}</a>{%- endif %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if site.tags.length > 0 %}
|
||||
{%- set tagsPageQuery = site.pages.find({type: 'tags'}, {lean: true}) %}
|
||||
{%- set hasTagsPage = tagsPageQuery.length > 0 %}
|
||||
<div class="site-state-item site-state-tags">
|
||||
{%- if hasTagsPage %}
|
||||
{%- if theme.menu.tags %}
|
||||
<a href="{{ url_for(theme.menu.tags.split('||')[0] | trim) }}">
|
||||
{% else %}
|
||||
<a href="{{ url_for(config.tag_dir) + '/' }}">
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
<span class="site-state-item-count">{{ site.tags.length }}</span>
|
||||
<span class="site-state-item-name">{{ __('state.tags') }}</span>
|
||||
{%- if hasTagsPage %}</a>{%- endif %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</nav>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.chat.enable and theme.chat.service !== '' %}
|
||||
<div class="sidebar-button motion-element">
|
||||
{%- if theme.chat.service == 'chatra' and theme.chatra.enable %}
|
||||
<a onclick="Chatra('openChat', true);">
|
||||
{%- endif %}
|
||||
{%- if theme.chat.service == 'tidio' and theme.tidio.enable %}
|
||||
<a onclick="tidioChatApi.open();">
|
||||
{%- endif %}
|
||||
{%- if theme.chat.icon %}<i class="{{ theme.chat.icon }}"></i>{%- endif %}
|
||||
{{ theme.chat.text }}
|
||||
</a>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.social %}
|
||||
<div class="links-of-author motion-element">
|
||||
{%- for name, link in theme.social %}
|
||||
<span class="links-of-author-item">
|
||||
{%- set sidebarURL = link.split('||')[0] | trim %}
|
||||
{%- if theme.social_icons.enable %}
|
||||
{%- set sidebarIcon = '<i class="' + link.split('||')[1] | trim + ' fa-fw"></i>' %}
|
||||
{%- else %}
|
||||
{%- set sidebarIcon = '' %}
|
||||
{%- endif %}
|
||||
{%- if theme.social_icons.enable and theme.social_icons.icons_only %}
|
||||
{%- set sidebarText = '' %}
|
||||
{%- else %}
|
||||
{%- set sidebarText = name %}
|
||||
{%- endif %}
|
||||
{{ next_url(sidebarURL, sidebarIcon + sidebarText, {title: name + ' → ' + sidebarURL}) }}
|
||||
</span>
|
||||
{%- endfor %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{%- if theme.creative_commons.license and theme.creative_commons.sidebar %}
|
||||
<div class="cc-license motion-element" itemprop="license">
|
||||
{%- set ccImage = '<img src="' + url_for(theme.images + '/cc-' + theme.creative_commons.license + '.svg') + '" alt="Creative Commons">' %}
|
||||
{{ next_url(ccURL, ccImage, {class: 'cc-opacity'}) }}
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
||||
{# Blogroll #}
|
||||
{%- if theme.links %}
|
||||
<div class="links-of-blogroll motion-element">
|
||||
<div class="links-of-blogroll-title">
|
||||
{%- if theme.links_settings.icon %}<i class="{{ theme.links_settings.icon }} fa-fw"></i>{%- endif %}
|
||||
{{ theme.links_settings.title }}
|
||||
</div>
|
||||
<ul class="links-of-blogroll-list">
|
||||
{%- for blogrollText, blogrollURL in theme.links %}
|
||||
<li class="links-of-blogroll-item">
|
||||
{{ next_url(blogrollURL, blogrollText, {title: blogrollURL}) }}
|
||||
</li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{%- endif %}
|
||||
20
themes/next/layout/_partials/widgets.swig
Normal file
20
themes/next/layout/_partials/widgets.swig
Normal file
@ -0,0 +1,20 @@
|
||||
{%- if theme.back2top.enable and not theme.back2top.sidebar %}
|
||||
<div class="back-to-top">
|
||||
<i class="fa fa-arrow-up"></i>
|
||||
<span>0%</span>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- if theme.reading_progress.enable %}
|
||||
<div class="reading-progress-bar"></div>
|
||||
{%- endif %}
|
||||
{%- if theme.bookmark.enable %}
|
||||
<a role="button" class="book-mark-link book-mark-link-fixed"></a>
|
||||
{%- endif %}
|
||||
{%- if theme.github_banner.enable %}
|
||||
{%- set github_URL = theme.github_banner.permalink %}
|
||||
{%- set github_title = theme.github_banner.title %}
|
||||
|
||||
{%- set github_image = '<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg>' %}
|
||||
|
||||
{{ next_url(github_URL, github_image, {class: 'github-corner', title: github_title, "aria-label": github_title}) }}
|
||||
{%- endif %}
|
||||
Reference in New Issue
Block a user