initial
This commit is contained in:
57
themes/next/layout/_partials/comments.swig
Normal file
57
themes/next/layout/_partials/comments.swig
Normal file
@ -0,0 +1,57 @@
|
||||
{% if page.comments %}
|
||||
|
||||
{% if theme.facebook_sdk.enable and theme.facebook_comments_plugin.enable %}
|
||||
<div class="comments" id="comments">
|
||||
<div class="fb-comments"
|
||||
data-href="{{ page.permalink }}"
|
||||
data-numposts="{{ theme.facebook_comments_plugin.num_of_posts }}"
|
||||
data-width="{{ theme.facebook_comments_plugin.width }}"
|
||||
data-colorscheme="{{ theme.facebook_comments_plugin.scheme }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% elif theme.vkontakte_api.enable and theme.vkontakte_api.comments %}
|
||||
<div class="comments" id="comments">
|
||||
<div id="vk_comments"></div>
|
||||
</div>
|
||||
|
||||
{% elif theme.disqus.enable or (theme.disqusjs.enable and theme.disqusjs.apikey and theme.disqusjs.shortname) %}
|
||||
<div class="comments" id="comments">
|
||||
<div id="disqus_thread">
|
||||
<noscript>{#
|
||||
#}Please enable JavaScript to view the comments powered by Disqus.{#
|
||||
#}</noscript>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% elif theme.livere_uid %}
|
||||
<div class="comments" id="comments">
|
||||
<div id="lv-container" data-id="city" data-uid="{{ theme.livere_uid }}"></div>
|
||||
</div>
|
||||
|
||||
{% elif theme.changyan.enable and theme.changyan.appid and theme.changyan.appkey %}
|
||||
<div class="comments" id="comments">
|
||||
<div id="SOHUCS"></div>
|
||||
</div>
|
||||
|
||||
{% elif theme.gitment.enable %}
|
||||
<div class="comments" id="comments">
|
||||
{% if theme.gitment.lazy %}
|
||||
<div onclick="showGitment()" id="gitment-display-button">{{ __('gitmentbutton') }}</div>
|
||||
<div id="gitment-container" style="display: none"></div>
|
||||
{% else %}
|
||||
<div id="gitment-container"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% elif theme.valine.enable and theme.valine.appid and theme.valine.appkey %}
|
||||
<div class="comments" id="comments">
|
||||
</div>
|
||||
|
||||
{% elif theme.gitalk.enable %}
|
||||
<div class="comments" id="gitalk-container">
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
62
themes/next/layout/_partials/footer.swig
Normal file
62
themes/next/layout/_partials/footer.swig
Normal file
@ -0,0 +1,62 @@
|
||||
<div class="copyright">{#
|
||||
#}{% set current = date(Date.now(), "YYYY") %}{#
|
||||
#}{% if theme.footer.beian.enable %}{#
|
||||
#} {{ next_url('http://www.beian.miit.gov.cn', theme.footer.beian.icp + ' ') }}{#
|
||||
#}{% endif %}{#
|
||||
#}© {% if theme.footer.since and theme.footer.since != current %}{{ theme.footer.since }} – {% endif %}{#
|
||||
#}<span itemprop="copyrightYear">{{ current }}</span>
|
||||
<span class="with-love" id="animate">
|
||||
<i class="fa fa-{{ theme.footer.icon.name }}"></i>
|
||||
</span>
|
||||
<span class="author" itemprop="copyrightHolder">{{ theme.footer.copyright || 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-area-chart"></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, theme.symbols_count_time.awl, theme.symbols_count_time.wpm, __('symbols_count_time.time_minutes')) }}{#
|
||||
#}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if theme.footer.powered.enable %}
|
||||
<div class="powered-by">{#
|
||||
#}{{ __('footer.powered', next_url('https://hexo.io', 'Hexo', {class: 'theme-link'})) }}{#
|
||||
#}{% if theme.footer.powered.version %} v{{ hexo_env('version') }}{% endif %}{#
|
||||
#}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.footer.powered.enable and theme.footer.theme.enable %}
|
||||
<span class="post-meta-divider">|</span>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.footer.theme.enable %}
|
||||
<div class="theme-info">{#
|
||||
#}{{ __('footer.theme') }} – {{ next_url('https://theme-next.org', 'NexT.' + theme.scheme, {class: 'theme-link'}) }}{#
|
||||
#}{% if theme.footer.theme.version %} v{{ version }}{% endif %}{#
|
||||
#}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.footer.custom_text %}
|
||||
<div class="footer-custom">{#
|
||||
#}{{ theme.footer.custom_text }}{#
|
||||
#}</div>
|
||||
{% endif %}
|
8
themes/next/layout/_partials/github-banner.swig
Normal file
8
themes/next/layout/_partials/github-banner.swig
Normal file
@ -0,0 +1,8 @@
|
||||
{% 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 %}
|
51
themes/next/layout/_partials/head/external-fonts.swig
Normal file
51
themes/next/layout/_partials/head/external-fonts.swig
Normal file
@ -0,0 +1,51 @@
|
||||
{% if theme.font.enable %}
|
||||
|
||||
{% set font_config = theme.font %}
|
||||
{% set font_families = '' %}
|
||||
{% set font_styles = ':300,300italic,400,400italic,700,700italic' %}
|
||||
{% set font_found = false %}
|
||||
|
||||
{% if font_config.global.family and font_config.global.external %}
|
||||
{% set font_families += font_config.global.family + font_styles %}
|
||||
{% set font_found = true %}
|
||||
{% endif %}
|
||||
|
||||
{% if font_config.headings.family and font_config.headings.external %}
|
||||
{% if font_found %}
|
||||
{% set font_families += '|' %}
|
||||
{% endif %}
|
||||
|
||||
{% set font_families += font_config.headings.family + font_styles %}
|
||||
{% endif %}
|
||||
|
||||
{% if font_config.posts.family and font_config.posts.external %}
|
||||
{% if font_found %}
|
||||
{% set font_families += '|' %}
|
||||
{% endif %}
|
||||
|
||||
{% set font_families += font_config.posts.family + font_styles %}
|
||||
{% endif %}
|
||||
|
||||
{% if font_config.logo.family and font_config.logo.external %}
|
||||
{% if font_found %}
|
||||
{% set font_families += '|' %}
|
||||
{% endif %}
|
||||
|
||||
{% set font_families += font_config.logo.family + font_styles %}
|
||||
{% endif %}
|
||||
|
||||
{% if font_config.codes.family and font_config.codes.external %}
|
||||
{% if font_found %}
|
||||
{% set font_families += '|' %}
|
||||
{% endif %}
|
||||
|
||||
{% set font_families += font_config.codes.family + font_styles %}
|
||||
{% endif %}
|
||||
|
||||
{% if font_families !== '' %}
|
||||
{% set font_families += '&subset=latin,latin-ext' %}
|
||||
{% set font_host = font_config.host | default('//fonts.googleapis.com') %}
|
||||
<link rel="stylesheet" href="{{ font_host }}/css?family={{ font_families }}"/>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
28
themes/next/layout/_partials/head/head-unique.swig
Normal file
28
themes/next/layout/_partials/head/head-unique.swig
Normal file
@ -0,0 +1,28 @@
|
||||
{{
|
||||
open_graph({
|
||||
twitter_id: theme.twitter,
|
||||
google_plus: theme.google_plus,
|
||||
fb_admins: theme.fb_admins,
|
||||
fb_app_id: theme.fb_app_id
|
||||
})
|
||||
}}
|
||||
|
||||
{% if theme.rss === '' and config.feed and config.feed.path %}
|
||||
{% set theme.rss = config.feed.path %}
|
||||
{% endif %}
|
||||
{% if theme.rss %}
|
||||
<link rel="alternate" href="{{ url_for(theme.rss) }}" title="{{ title }}" type="application/atom+xml"/>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.canonical %}
|
||||
{% set without_index = url.replace('index.html', '') %}
|
||||
{% set without_html = without_index.replace('.html', '') %}
|
||||
<link rel="canonical" href="{{ without_html }}"/>
|
||||
{% endif %}
|
||||
|
||||
{# Exports some front-matter variables to Front-End #}
|
||||
<script id="page.configurations">
|
||||
CONFIG.page = {
|
||||
sidebar: {{ page.sidebar | json_encode }},
|
||||
};
|
||||
</script>
|
128
themes/next/layout/_partials/head/head.swig
Normal file
128
themes/next/layout/_partials/head/head.swig
Normal file
@ -0,0 +1,128 @@
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2"/>
|
||||
<meta name="theme-color" content="{{ theme.android_chrome_color }}"/>
|
||||
|
||||
{% if theme.needmoreshare2.enable %}
|
||||
{% set needmoreshare2_css = url_for(theme.vendors._internal + '/needsharebutton/needsharebutton.css') %}
|
||||
{% if theme.vendors.needmoreshare2_css %}
|
||||
{% set needmoreshare2_css = theme.vendors.needmoreshare2_css %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ needmoreshare2_css }}"/>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.pace %}
|
||||
{% set pace_css_uri = url_for(theme.vendors._internal + '/pace/'+ theme.pace_theme +'.min.css?v=1.0.2') %}
|
||||
{% set pace_js_uri = url_for(theme.vendors._internal + '/pace/pace.min.js?v=1.0.2') %}
|
||||
{% if theme.vendors.pace %}
|
||||
{% set pace_js_uri = theme.vendors.pace %}
|
||||
{% endif %}
|
||||
{% if theme.vendors.pace_css %}
|
||||
{% set pace_css_uri = theme.vendors.pace_css %}
|
||||
{% endif %}
|
||||
<script src="{{ pace_js_uri }}"></script>
|
||||
<link rel="stylesheet" href="{{ pace_css_uri }}"/>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.han %}
|
||||
{% set Han_uri = url_for(theme.vendors._internal + '/Han/dist/han.min.css?v=3.3') %}
|
||||
{% if theme.vendors.han %}
|
||||
{% set Han_uri = theme.vendors.han %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ Han_uri }}"/>
|
||||
{% 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 %}
|
||||
|
||||
{% if theme.fancybox %}
|
||||
{% set fancybox_css_uri = url_for(theme.vendors._internal + '/fancybox/source/jquery.fancybox.css') %}
|
||||
{% if theme.vendors.fancybox_css %}
|
||||
{% set fancybox_css_uri = theme.vendors.fancybox_css %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ fancybox_css_uri }}"/>
|
||||
{% endif %}
|
||||
|
||||
{% include "./external-fonts.swig" %}
|
||||
|
||||
{% set font_awesome_uri = url_for(theme.vendors._internal + '/font-awesome/css/font-awesome.min.css?v=4.6.2') %}
|
||||
{% if theme.vendors.fontawesome %}
|
||||
{% set font_awesome_uri = theme.vendors.fontawesome %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ font_awesome_uri }}"/>
|
||||
|
||||
<link rel="stylesheet" href="{{ url_for(theme.css) }}/main.css?v={{ version }}"/>
|
||||
|
||||
{% if theme.favicon.apple_touch_icon %}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for(theme.favicon.apple_touch_icon) }}?v={{ version }}">
|
||||
{% endif %}
|
||||
{% if theme.favicon.medium %}
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for(theme.favicon.medium) }}?v={{ version }}">
|
||||
{% endif %}
|
||||
{% if theme.favicon.small %}
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for(theme.favicon.small) }}?v={{ version }}">
|
||||
{% endif %}
|
||||
{% if theme.favicon.safari_pinned_tab %}
|
||||
<link rel="mask-icon" href="{{ url_for(theme.favicon.safari_pinned_tab) }}?v={{ version }}" 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.facebook_sdk.enable and theme.facebook_sdk.webmaster %}
|
||||
<meta property="fb:admins" content="{{ theme.facebook_sdk.fb_admin }}"/>
|
||||
<meta property="fb:app_id" content="{{ theme.facebook_sdk.app_id }}"/>
|
||||
{% endif %}
|
||||
|
||||
{# Export some HEXO Configurations to Front-End #}
|
||||
<script id="hexo.configurations">
|
||||
var NexT = window.NexT || {};
|
||||
var CONFIG = {
|
||||
root: '{{ theme.root }}',
|
||||
scheme: '{{ theme.scheme }}',
|
||||
version: '{{ version }}',
|
||||
sidebar: {{ theme.sidebar | json_encode }},
|
||||
back2top: {{ theme.back2top.enable }},
|
||||
back2top_sidebar: {{ theme.back2top.sidebar }},
|
||||
fancybox: {{ theme.fancybox }},
|
||||
fastclick: {{ theme.fastclick }},
|
||||
lazyload: {{ theme.lazyload }},
|
||||
tabs: {{ theme.tabs.enable }},
|
||||
motion: {{ theme.motion | json_encode }},
|
||||
algolia: {
|
||||
applicationID: '{{ theme.algolia.applicationID }}',
|
||||
apiKey: '{{ theme.algolia.apiKey }}',
|
||||
indexName: '{{ theme.algolia.indexName }}',
|
||||
hits: {{ theme.algolia_search.hits | json_encode }},
|
||||
labels: {{ theme.algolia_search.labels | json_encode }}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
{% if theme.custom_file_path.head %}
|
||||
{% set custom_head = '../../../../../' + theme.custom_file_path.head %}
|
||||
{% else %}
|
||||
{% set custom_head = '../../_custom/head.swig' %}
|
||||
{% endif %}
|
||||
{% include custom_head %}
|
39
themes/next/layout/_partials/header/brand.swig
Normal file
39
themes/next/layout/_partials/header/brand.swig
Normal file
@ -0,0 +1,39 @@
|
||||
<div class="site-brand-wrapper">
|
||||
<div class="site-meta{% if theme.custom_logo.enable %} custom-logo{% endif %}">
|
||||
{% if theme.custom_logo.enable and theme.custom_logo.image and theme.scheme === 'Muse' %}
|
||||
<div class="site-meta-headline">
|
||||
<a>
|
||||
<img class="custom-logo-image" src="{{ theme.custom_logo.image }}" alt="{{ title }}"/>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="custom-logo-site-title">
|
||||
<a href="{{ config.root }}" class="brand" rel="start">
|
||||
<span class="logo-line-before"><i></i></span>
|
||||
<span class="site-title">{{ title }}</span>
|
||||
<span class="logo-line-after"><i></i></span>
|
||||
</a>
|
||||
</div>
|
||||
{% if subtitle %}
|
||||
{% if theme.seo %}
|
||||
<h1 class="site-subtitle" itemprop="description">{{ subtitle }}</h1>
|
||||
{% else %}
|
||||
<p class="site-subtitle">{{ subtitle }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if theme.custom_logo.enable and theme.custom_logo.image and (theme.scheme === 'Gemini' or theme.scheme === 'Pisces') %}
|
||||
<a>
|
||||
<img class="custom-logo-image" src="{{ theme.custom_logo.image }}" alt="{{ title }}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="site-nav-toggle">
|
||||
<button aria-label="{{ __('accessibility.nav_toggle') }}">
|
||||
<span class="btn-bar"></span>
|
||||
<span class="btn-bar"></span>
|
||||
<span class="btn-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
9
themes/next/layout/_partials/header/index.swig
Normal file
9
themes/next/layout/_partials/header/index.swig
Normal file
@ -0,0 +1,9 @@
|
||||
{{ partial('_partials/header/brand.swig', {}, {cache: theme.cache.enable}) }}
|
||||
{% include 'menu.swig' %}
|
||||
|
||||
{% if theme.custom_file_path.header %}
|
||||
{% set custom_header = '../../../../../' + theme.custom_file_path.header %}
|
||||
{% else %}
|
||||
{% set custom_header = '../../_custom/header.swig' %}
|
||||
{% endif %}
|
||||
{% include custom_header %}
|
52
themes/next/layout/_partials/header/menu.swig
Normal file
52
themes/next/layout/_partials/header/menu.swig
Normal file
@ -0,0 +1,52 @@
|
||||
{% import '../../_macro/menu/menu-item.swig' as menu_item %}
|
||||
|
||||
<nav class="site-nav">
|
||||
{% if theme.menu %}
|
||||
<ul id="menu" class="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.toLowerCase() %}
|
||||
{% set respath = subpath %}
|
||||
{% if itemName == 'default' %}
|
||||
{% set itemName = name.toLowerCase() %}
|
||||
{{ menu_item.render(name, respath) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{# Main Menu (standart menu items) #}
|
||||
{% set itemName = name.toLowerCase() %}
|
||||
{{- menu_item.render(name, respath) | trim -}}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
|
||||
{% set hasSearch = theme.swiftype_key || theme.algolia_search.enable || theme.local_search.enable %}
|
||||
{% if hasSearch %}
|
||||
<li class="menu-item menu-item-search">
|
||||
{% if theme.swiftype_key %}
|
||||
<a href="javascript:;" class="st-search-show-outputs">
|
||||
{% elif theme.local_search.enable || theme.algolia_search.enable %}
|
||||
<a href="javascript:;" class="popup-trigger">
|
||||
{% endif %}
|
||||
{% if theme.menu_settings.icons %}
|
||||
<i class="menu-item-icon fa fa-search fa-fw"></i> <br/>{#
|
||||
#}{% endif %}{#
|
||||
#}{{ __('menu.search') }}{#
|
||||
#}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if theme.scheme === 'Muse' || theme.scheme === 'Mist' %}
|
||||
{% include 'sub-menu.swig' %}
|
||||
{% endif %}
|
||||
|
||||
{% if hasSearch %}
|
||||
<div class="site-search">
|
||||
{% include '../search/index.swig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</nav>
|
100
themes/next/layout/_partials/header/sub-menu.swig
Normal file
100
themes/next/layout/_partials/header/sub-menu.swig
Normal file
@ -0,0 +1,100 @@
|
||||
{% if not is_home() && not is_post() %}
|
||||
{% if theme.menu %}
|
||||
|
||||
{% import '../../_macro/menu/menu-item.swig' as menu_item %}
|
||||
|
||||
{# 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('/', '', 'g') %}
|
||||
|
||||
{# 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.toLowerCase() %}
|
||||
{% if itemName == 'default' %}
|
||||
{% set parentValue = subvalue.split('||')[0] | trim %}
|
||||
{% else %}
|
||||
{% if subvalue.indexOf('http') == 0 %}
|
||||
{% set respath = subvalue %}
|
||||
{% else %}
|
||||
{% set respath = parentValue + subvalue %}
|
||||
{% endif %}
|
||||
{{ menu_item.render(subname, respath) }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{# For 'default' submenu item in main submenu #}
|
||||
{% set itemName = subname.toLowerCase() %}
|
||||
{% for subname2, subvalue2 in subvalue %}
|
||||
{% if subname2 == 'default' %}
|
||||
{% set respath = parentValue + subvalue2 %}
|
||||
{{ menu_item.render(subname, 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.toLowerCase() %}
|
||||
{% 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('/', '', 'g') %}
|
||||
|
||||
{# Submenu-2 items #}
|
||||
<ul id="sub-menu-2" class="sub-menu menu">
|
||||
{% for subname2, subvalue2 in subvalue %}
|
||||
{% set respath2 = subvalue %}
|
||||
{% set itemName = subname2.toLowerCase() %}
|
||||
{% if itemName == 'default' %}
|
||||
{% set parentSubValue = subvalue2.split('||')[0] | trim %}
|
||||
{% else %}
|
||||
{% if subvalue2.indexOf('http') == 0 %}
|
||||
{% set respath2 = subvalue2 %}
|
||||
{% else %}
|
||||
{% set respath2 = parentValue + parentSubValue + subvalue2 %}
|
||||
{% endif %}
|
||||
{{ menu_item.render(subname2, 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 %}
|
||||
{% 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 += 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 += '/' + path %}
|
||||
{% endif %}
|
||||
{% if path.indexOf('.html') == -1 %}
|
||||
<li><a href="{{ url_for(link) }}/">{{ path | upper }}</a></li>
|
||||
{% else %}
|
||||
<li>{{ path.replace('.html', '') | upper }}</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">
|
||||
|
||||
<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title" itemprop="name headline">
|
||||
{{- page.title -}}
|
||||
{% include '../post-edit.swig' %}
|
||||
</{% if theme.seo %}h2{% else %}h1{% endif %}>
|
||||
|
||||
<div class="post-meta">
|
||||
{% if page.description %}
|
||||
<div class="post-description">{{ page.description }}</div>
|
||||
{% endif %}
|
||||
{% include 'breadcrumb.swig' %}
|
||||
</div>
|
||||
|
||||
</header>
|
11
themes/next/layout/_partials/pagination.swig
Normal file
11
themes/next/layout/_partials/pagination.swig
Normal file
@ -0,0 +1,11 @@
|
||||
{% 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
|
||||
})
|
||||
}}
|
||||
</nav>
|
||||
{% endif %}
|
4
themes/next/layout/_partials/post-edit.swig
Normal file
4
themes/next/layout/_partials/post-edit.swig
Normal file
@ -0,0 +1,4 @@
|
||||
{% if theme.post_edit.enable -%}
|
||||
{% set editIcon = '<i class="fa fa-pencil"></i>' -%}
|
||||
{{ next_url(theme.post_edit.url + page.source, editIcon, {class: 'post-edit-link', title: __('post.edit') }) }}
|
||||
{%- endif %}
|
26
themes/next/layout/_partials/post/post-copyright.swig
Normal file
26
themes/next/layout/_partials/post/post-copyright.swig
Normal file
@ -0,0 +1,26 @@
|
||||
{% set ccLicense = theme.creative_commons.license | lower %}
|
||||
{% set ccLanguage = theme.creative_commons.language %}
|
||||
{% set ccIcon = '<i class="fa fa-fw fa-creative-commons"></i>' %}
|
||||
{% set ccText = ccLicense | upper %}
|
||||
{% if ccLicense === 'zero' %}
|
||||
{% set ccType = 'publicdomain/zero/1.0/' + ccLanguage %}
|
||||
{% else %}
|
||||
{% set ccType = 'licenses/' + ccLicense + '/4.0/' + ccLanguage %}
|
||||
{% endif %}
|
||||
{% set ccURL = 'https://creativecommons.org/' + ccType %}
|
||||
|
||||
<ul class="post-copyright">
|
||||
<li class="post-copyright-author">
|
||||
<strong>{{ __('post.copyright.author') + __('symbol.colon') }} </strong>{#
|
||||
#}{{ post.author || author }}{#
|
||||
#}</li>
|
||||
<li class="post-copyright-link">
|
||||
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
|
||||
{% set postURL = post.url || post.permalink %}
|
||||
{{ next_url(postURL, postURL, {title: post.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>
|
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, post) %}
|
||||
{% if popular_posts.json and popular_posts.json.length > 0 %}
|
||||
<div class="popular-posts-header">{{ theme.related_posts.title | default(__('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 && 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 && 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/reward.swig
Normal file
22
themes/next/layout/_partials/post/reward.swig
Normal file
@ -0,0 +1,22 @@
|
||||
<div id="reward-container">
|
||||
<div>{{ theme.reward_settings.comment }}</div>
|
||||
<button id="reward-button" disable="enable" 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', 'bitcoin'] %}
|
||||
{% if builtin.indexOf(name) !== -1 %}
|
||||
{% 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>
|
4
themes/next/layout/_partials/post/wechat-subscriber.swig
Normal file
4
themes/next/layout/_partials/post/wechat-subscriber.swig
Normal file
@ -0,0 +1,4 @@
|
||||
<div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center;">
|
||||
<img id="wechat_subscriber_qcode" src="{{ url_for(theme.wechat_subscriber.qcode) }}" alt="{{ author }} wechat" style="width: 200px; max-width: 100%;"/>
|
||||
<div>{{ theme.wechat_subscriber.description }}</div>
|
||||
</div>
|
20
themes/next/layout/_partials/search/algolia-search.swig
Normal file
20
themes/next/layout/_partials/search/algolia-search.swig
Normal file
@ -0,0 +1,20 @@
|
||||
{% if theme.algolia_search.enable %}
|
||||
<div class="algolia-popup popup search-popup">
|
||||
<div class="algolia-search">
|
||||
<div class="algolia-search-input-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</div>
|
||||
<div class="algolia-search-input" id="algolia-search-input"></div>
|
||||
</div>
|
||||
|
||||
<div class="algolia-results">
|
||||
<div id="algolia-stats"></div>
|
||||
<div id="algolia-hits"></div>
|
||||
<div id="algolia-pagination" class="algolia-pagination"></div>
|
||||
</div>
|
||||
|
||||
<span class="popup-btn-close">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
7
themes/next/layout/_partials/search/index.swig
Normal file
7
themes/next/layout/_partials/search/index.swig
Normal file
@ -0,0 +1,7 @@
|
||||
{% if theme.algolia_search.enable %}
|
||||
{% include 'algolia-search.swig' %}
|
||||
{% elif theme.swiftype_key %}
|
||||
{% include 'swiftype.swig' %}
|
||||
{% elif theme.local_search.enable %}
|
||||
{% include 'localsearch.swig' %}
|
||||
{% endif %}
|
16
themes/next/layout/_partials/search/localsearch.swig
Normal file
16
themes/next/layout/_partials/search/localsearch.swig
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="popup search-popup local-search-popup">
|
||||
<div class="local-search-header clearfix">
|
||||
<span class="search-icon">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
<span class="popup-btn-close">
|
||||
<i class="fa fa-times-circle"></i>
|
||||
</span>
|
||||
<div class="local-search-input-wrapper">
|
||||
<input autocomplete="off"
|
||||
placeholder="{{ __('search.placeholder') }}" spellcheck="false"
|
||||
type="text" id="local-search-input">
|
||||
</div>
|
||||
</div>
|
||||
<div id="local-search-result"></div>
|
||||
</div>
|
12
themes/next/layout/_partials/search/swiftype.swig
Normal file
12
themes/next/layout/_partials/search/swiftype.swig
Normal file
@ -0,0 +1,12 @@
|
||||
<form class="site-search-form">
|
||||
<input type="text" id="st-search-input" class="st-search-input st-default-search-input"/>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
|
||||
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
|
||||
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
|
||||
})(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');
|
||||
|
||||
_st('install', '{{ theme.swiftype_key }}','2.0.0');
|
||||
</script>
|
3
themes/next/layout/_partials/share/add-this.swig
Normal file
3
themes/next/layout/_partials/share/add-this.swig
Normal file
@ -0,0 +1,3 @@
|
||||
<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>
|
57
themes/next/layout/_partials/share/baidushare.swig
Normal file
57
themes/next/layout/_partials/share/baidushare.swig
Normal file
@ -0,0 +1,57 @@
|
||||
{% if theme.baidushare.type === "button" %}
|
||||
<div class="bdsharebuttonbox">
|
||||
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
|
||||
<a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a>
|
||||
<a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
|
||||
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
|
||||
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
|
||||
<a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧"></a>
|
||||
<a href="#" class="bds_twi" data-cmd="twi" title="分享到Twitter"></a>
|
||||
<a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a>
|
||||
<a href="#" class="bds_more" data-cmd="more"></a>
|
||||
<a class="bds_count" data-cmd="count"></a>
|
||||
</div>
|
||||
<script>
|
||||
window._bd_share_config = {
|
||||
"common": {
|
||||
"bdText": "",
|
||||
"bdMini": "2",
|
||||
"bdMiniList": false,
|
||||
"bdPic": ""
|
||||
},
|
||||
"share": {
|
||||
"bdSize": "16",
|
||||
"bdStyle": "0"
|
||||
},
|
||||
"image": {
|
||||
"viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
|
||||
"viewText": "分享到:",
|
||||
"viewSize": "16"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% elif theme.baidushare.type === "slide" %}
|
||||
<script>
|
||||
window._bd_share_config = {
|
||||
"common": {
|
||||
"bdText": "",
|
||||
"bdMini": "1",
|
||||
"bdMiniList": false,
|
||||
"bdPic": ""
|
||||
},
|
||||
"image": {
|
||||
"viewList": ["tsina", "douban", "sqq", "qzone", "weixin", "twi", "fbook"],
|
||||
"viewText": "分享到:",
|
||||
"viewSize": "16"
|
||||
},
|
||||
"slide": {
|
||||
"bdImg": "5",
|
||||
"bdPos": "left",
|
||||
"bdTop": "100"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
<script>
|
||||
with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
|
||||
</script>
|
23
themes/next/layout/_partials/share/likely.swig
Normal file
23
themes/next/layout/_partials/share/likely.swig
Normal file
@ -0,0 +1,23 @@
|
||||
{% set likely_js_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.js' %}
|
||||
{% if theme.vendors.likely_js %}
|
||||
{% set likely_js_url = theme.vendors.likely_js %}
|
||||
{% endif %}
|
||||
<script src="{{ likely_js_url }}"></script>
|
||||
|
||||
{% set likely_css_url = '//cdn.jsdelivr.net/npm/ilyabirman-likely@2/release/likely.css' %}
|
||||
{% if theme.vendors.likely_css %}
|
||||
{% set likely_css_url = theme.vendors.likely_css %}
|
||||
{% endif %}
|
||||
<link rel="stylesheet" href="{{ likely_css_url }}">
|
||||
|
||||
{% if theme.likely.look == 'normal' %}
|
||||
{% set likely_look = 'likely' %}
|
||||
{% else %}
|
||||
{% set likely_look = 'likely likely-' + theme.likely.look %}
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ likely_look }}">
|
||||
{% for x in theme.likely.networks %}
|
||||
<div class="{{ loop.key }}">{{ x }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
Reference in New Issue
Block a user