Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"$",
"jQuery",
"NexT",
"CONFIG"
"CONFIG",
"require",
"hexo"
],
"quotmark": true,
"trailing": true,
Expand Down
4 changes: 0 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,3 @@ vendors:
css: css
js: js
images: images

# Theme version
version: 6.2.0

5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
"version": "6.2.0",
"homepage": "https://theme-next.org",
"authors": [
"iissnan <iissnan@gmail.com>",
"Ivan Nginx <ivan.nginx@gmail.com> (https://almostover.ru)"
"NexT <support@theme-next.org> (https://theme-next.org)"
],
"description": "Elegant theme for Hexo",
"repository": "https://github.com/theme-next/hexo-theme-next",
"keywords": [
"hexo",
"theme",
"NexT"
"next"
],
"license": "AGPL",
"ignore": [
Expand Down
3 changes: 3 additions & 0 deletions layout/_layout.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<!DOCTYPE html>

{# NexT version #}
{% set version = next_env('version') %}

{% set html_class = 'theme-next ' + theme.scheme %}
{% if theme.motion.enable %}
{% set html_class = html_class + ' use-motion' %}
Expand Down
4 changes: 2 additions & 2 deletions layout/_partials/footer.swig
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

{% if theme.footer.powered.enable %}
<div class="powered-by">{#
#}{{ __('footer.powered', '<a class="theme-link" target="_blank"' + nofollow + ' href="https://hexo.io">Hexo</a>') }}{% if theme.footer.powered.version %} v{{ hexo_version() }}{% endif %}{#
#}{{ __('footer.powered', '<a class="theme-link" target="_blank"' + nofollow + ' href="https://hexo.io">Hexo</a>') }}{% if theme.footer.powered.version %} v{{ hexo_env('version') }}{% endif %}{#
#}</div>
{% endif %}

Expand All @@ -53,7 +53,7 @@
#}{{ __('footer.theme') }} &mdash; {#
#}<a class="theme-link" target="_blank"{{ nofollow }} href="https://github.com/theme-next/hexo-theme-next">{#
#}NexT.{{ theme.scheme }}{#
#}</a>{% if theme.footer.theme.version %} v{{ theme.version }}{% endif %}{#
#}</a>{% if theme.footer.theme.version %} v{{ version }}{% endif %}{#
#}</div>
{% endif %}

Expand Down
12 changes: 6 additions & 6 deletions layout/_partials/head/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@
{% endif %}
<link href="{{ font_awesome_uri }}" rel="stylesheet" type="text/css" />

<link href="{{ url_for(theme.css) }}/main.css?v={{ theme.version }}" rel="stylesheet" type="text/css" />
<link href="{{ url_for(theme.css) }}/main.css?v={{ version }}" rel="stylesheet" type="text/css" />

{% if theme.favicon.apple_touch_icon %}
<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for(theme.favicon.apple_touch_icon) }}?v={{ theme.version }}">
<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={{ theme.version }}">
<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={{ theme.version }}">
<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={{ theme.version }}" color="{{ theme.android_chrome_color }}">
<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) }}">
Expand All @@ -114,7 +114,7 @@
var CONFIG = {
root: '{{ theme.root }}',
scheme: '{{ theme.scheme }}',
version: '{{ theme.version }}',
version: '{{ version }}',
sidebar: {{ theme.sidebar | json_encode }},
fancybox: {{ theme.fancybox }},
fastclick: {{ theme.fastclick }},
Expand Down
2 changes: 1 addition & 1 deletion layout/_scripts/boostrap.swig
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
%}

{% for bs in boot_scripts %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ bs }}?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ bs }}?v={{ version }}"></script>
{% endfor %}
2 changes: 1 addition & 1 deletion layout/_scripts/commons.swig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
%}

{% for common in js_commons %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ common }}?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ common }}?v={{ version }}"></script>
{% endfor %}
4 changes: 2 additions & 2 deletions layout/_scripts/pages/post-details.swig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/scrollspy.js?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/post-details.js?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/scrollspy.js?v={{ version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/post-details.js?v={{ version }}"></script>
2 changes: 1 addition & 1 deletion layout/_scripts/schemes/gemini.swig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
%}

{% for script in scripts %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ script }}?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ script }}?v={{ version }}"></script>
{% endfor %}
2 changes: 1 addition & 1 deletion layout/_scripts/schemes/pisces.swig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
%}

{% for script in scripts %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ script }}?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/{{ script }}?v={{ version }}"></script>
{% endfor %}
2 changes: 1 addition & 1 deletion layout/_third-party/exturl.swig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% if theme.exturl %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/exturl.js?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/exturl.js?v={{ version }}"></script>
{% endif %}
4 changes: 2 additions & 2 deletions layout/_third-party/scroll-cookie.swig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if theme.save_scroll %}
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/js.cookie.js?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/scroll-cookie.js?v={{ theme.version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/js.cookie.js?v={{ version }}"></script>
<script type="text/javascript" src="{{ url_for(theme.js) }}/src/scroll-cookie.js?v={{ version }}"></script>
{% endif %}
2 changes: 1 addition & 1 deletion layout/_third-party/search/algolia-search/assets.swig
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<script src="{{ algolia_instant_js }}"></script>
{# E: Include Algolia instantsearch.js library #}

<script src="{{ url_for(theme.js) }}/src/algolia-search.js?v={{ theme.version }}"></script>
<script src="{{ url_for(theme.js) }}/src/algolia-search.js?v={{ version }}"></script>
{% endif %}
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
"url": "git+https://github.com/theme-next/hexo-theme-next.git"
},
"keywords": [
"NexT",
"Hexo"
"hexo",
"theme",
"next"
],
"author": "iissnan <iissnan@gmail.com>",
"maintainers": [
"Ivan Nginx <ivan.nginx@gmail.com> (https://almostover.ru)"
],
"author": "NexT <support@theme-next.org> (https://theme-next.org)",
"license": "AGPL",
"bugs": {
"url": "https://github.com/theme-next/hexo-theme-next/issues"
Expand Down
13 changes: 9 additions & 4 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
'use strict';

hexo.extend.helper.register('hexo_env', function(type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'hexo' is not defined.

return this.env[type];
});

hexo.extend.helper.register('next_env', function(type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'hexo' is not defined.

var env = require('../package.json');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'require' is not defined.

return env[type];
});

hexo.extend.helper.register('item_active', function(path, className) {
var canonical = this.page.canonical_path;
var current = this.url_for(canonical).replace('index.html', '', 'g');
Expand All @@ -12,7 +21,3 @@ hexo.extend.helper.register('item_active', function(path, className) {
}
return result;
});

hexo.extend.helper.register('hexo_version', function() {
return this.env.version;
});