2 | {% set current = date(Date.now(), "YYYY") %}
3 | © {% if theme.since and theme.since != current %} {{ theme.since }} - {% endif %}
4 | {{ current }}
5 |
6 |
7 |
8 | {{ config.author }}
9 |
10 |
11 |
12 |
13 | {% include '../_scripts/analytics/zhanzhang-analytics.swig' %}
14 |
15 |
10 |
11 |
12 | {{ page.category }}
13 | {{ __('title.category') }}
14 |
15 |
16 |
17 | {% for post in page.posts %}
18 | {{ post_template.render(post) }}
19 | {% endfor %}
20 |
21 |
22 | {% include '_partials/pagination.swig' %}
23 |
24 | {% endblock %}
25 |
26 | {% block sidebar %}
27 | {{ sidebar_template.render(false) }}
28 | {% endblock %}
29 |
30 |
31 | {% block script_extra_before %}
32 | {% if theme.use_motion %}
33 |
36 | {% endif %}
37 | {% endblock %}
38 |
--------------------------------------------------------------------------------
/themes/nextNew/layout/index.swig:
--------------------------------------------------------------------------------
1 | {% extends '_layout.swig' %}
2 | {% import '_macro/post.swig' as post_template %}
3 | {% import '_macro/sidebar.swig' as sidebar_template %}
4 |
5 | {% block title %} {{ config.title }} {% endblock %}
6 |
7 | {% block page_class %}
8 | {% if is_home() %} page-home {% endif %}
9 | {% endblock %}
10 |
11 | {% block content %}
12 |
19 | {# tagcloud page support #}
20 | {% if page.type === "tags" %}
21 |
22 |
23 | {{ _p('counter.tag_cloud', site.tags.length) }}
24 |
25 |
26 | {{ tagcloud({min_font: 12, max_font: 30, amount: 200, color: true, start_color: '#ccc', end_color: '#111'}) }}
27 |
28 |
29 | {% elif page.type === 'categories' %}
30 |
31 |
32 | {{ _p('counter.categories', site.categories.length) }}
33 |
34 |
35 | {{ list_categories() }}
36 |
37 |
38 | {% else %}
39 | {{ page.content }}
40 | {% endif %}
41 |
42 |
43 | {% endblock %}
44 |
45 | {% block sidebar %}
46 | {{ sidebar_template.render(false) }}
47 | {% endblock %}
48 |
--------------------------------------------------------------------------------
/themes/nextNew/layout/post.swig:
--------------------------------------------------------------------------------
1 | {% extends '_layout.swig' %}
2 | {% import '_macro/post.swig' as post_template %}
3 | {% import '_macro/sidebar.swig' as sidebar_template %}
4 |
5 |
6 | {% block title %} {{ page.title }} | {{ config.title }} {% endblock %}
7 |
8 | {% block page_class %}page-post-detail{% endblock %}
9 |
10 |
11 | {% block content %}
12 |
13 |
14 | {{ post_template.render(page) }}
15 |
16 |
17 |
18 |
28 |
29 | {% include '_scripts/ads/bottom-jd-ads.swig' %}
30 |
31 |
32 |
33 |
34 | {% if theme.jiathis %}
35 | {% include '_partials/share/jiathis.swig' %}
36 | {% elseif theme.duoshuo_shortname and theme.duoshuo_share %}
37 | {% include '_partials/share/duoshuo_share.swig' %}
38 | {% elseif theme.baidu_share %}
39 | {% include '_partials/share/baidu_share.swig' %}
40 | {% elseif theme.share_js %}
41 | {% include '_partials/share/share_js.swig' %}
42 | {% endif %}
43 |
44 |
45 |
46 | {% endblock %}
47 |
48 | {% block sidebar %}
49 | {{ sidebar_template.render(true) }}
50 | {% endblock %}
51 |
52 |
53 | {% block script_extra %}
54 | {% include '_scripts/pages/post-details.swig' %}
55 | {% endblock %}
56 |
--------------------------------------------------------------------------------
/themes/nextNew/layout/tag.swig:
--------------------------------------------------------------------------------
1 | {% extends '_layout.swig' %}
2 | {% import '_macro/post-collapse.swig' as post_template %}
3 | {% import '_macro/sidebar.swig' as sidebar_template %}
4 |
5 | {% block title %} {{ __('title.tag') }}: {{ page.tag }} | {{ config.title }} {% endblock %}
6 |
7 | {% block content %}
8 |
9 |
10 |
11 |
12 | {{ page.tag }}
13 | {{ __('title.tag') }}
14 |
15 |
16 |
17 | {% for post in page.posts %}
18 | {{ post_template.render(post) }}
19 | {% endfor %}
20 |
21 |
22 | {% include '_partials/pagination.swig' %}
23 | {% endblock %}
24 |
25 | {% block sidebar %}
26 | {{ sidebar_template.render(false) }}
27 | {% endblock %}
28 |
29 | {% block script_extra_before %}
30 | {% if theme.use_motion %}
31 |
34 | {% endif %}
35 | {% endblock %}
36 |
--------------------------------------------------------------------------------
/themes/nextNew/scripts/filters/sticky.js:
--------------------------------------------------------------------------------
1 | /* global hexo */
2 |
3 | var PRIORITY_AFTER_BUILTIN_FILTER = 11;
4 |
5 | hexo.extend.filter.register('before_generate', function () {
6 |
7 | this.model('Post').toArray().map(function (post) {
8 | var sticky = Number(post.sticky);
9 | post.sticky = isNaN(sticky) ? 0 : sticky;
10 | post.save();
11 | });
12 |
13 | }, PRIORITY_AFTER_BUILTIN_FILTER);
14 |
--------------------------------------------------------------------------------
/themes/nextNew/scripts/merge-configs.js:
--------------------------------------------------------------------------------
1 | /* global hexo */
2 |
3 | /**
4 | * Merge configs in _data/next.yml into hexo.theme.config.
5 | * Note: configs in _data/next.yml will override configs in hexo.theme.config.
6 | */
7 | hexo.on('generateBefore', function () {
8 | if (hexo.locals.get) {
9 | var data = hexo.locals.get('data');
10 | data && data.next && assign(hexo.theme.config, data.next);
11 | }
12 | });
13 |
14 |
15 | // https://github.com/sindresorhus/object-assign
16 | function assign(target, source) {
17 | var from;
18 | var keys;
19 | var to = toObject(target);
20 |
21 | for (var s = 1; s < arguments.length; s++) {
22 | from = arguments[s];
23 | keys = ownEnumerableKeys(Object(from));
24 |
25 | for (var i = 0; i < keys.length; i++) {
26 | to[keys[i]] = from[keys[i]];
27 | }
28 | }
29 |
30 | return to;
31 | }
32 |
33 | function toObject(val) {
34 | if (val == null) {
35 | throw new TypeError('Object.assign cannot be called with null or undefined');
36 | }
37 |
38 | return Object(val);
39 | }
40 |
41 | function ownEnumerableKeys(obj) {
42 | var keys = Object.getOwnPropertyNames(obj);
43 |
44 | if (Object.getOwnPropertySymbols) {
45 | keys = keys.concat(Object.getOwnPropertySymbols(obj));
46 | }
47 |
48 | return keys.filter(function (key) {
49 | return Object.prototype.propertyIsEnumerable.call(obj, key);
50 | });
51 | }
52 |
--------------------------------------------------------------------------------
/themes/nextNew/scripts/tags/center-quote.js:
--------------------------------------------------------------------------------
1 | /* global hexo */
2 | // Usage: {% centerquote %} Something {% endcenterquote %}
3 | // Alias: {% cq %} Something {% endcq %}
4 |
5 | function centerQuote (args, content) {
6 | return '