mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Update next_js helper
This commit is contained in:
parent
2ca7577f0a
commit
bd69da6470
@ -14,7 +14,7 @@
|
|||||||
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
|
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
|
||||||
</div>
|
</div>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{{- next_js('comments-buttons.js', true) }}
|
{{- next_js('comments-buttons.js', { pjax: true }) }}
|
||||||
{%- elif theme.comments.style == 'tabs' %}
|
{%- elif theme.comments.style == 'tabs' %}
|
||||||
<div class="tabs tabs-comment">
|
<div class="tabs tabs-comment">
|
||||||
<ul class="nav-tabs">
|
<ul class="nav-tabs">
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
<div class="event-list">
|
<div class="event-list">
|
||||||
</div>
|
</div>
|
||||||
{{- next_js('schedule.js', true) }}
|
{{- next_js('schedule.js', { pjax: true }) }}
|
||||||
|
|||||||
@ -17,7 +17,10 @@ hexo.extend.helper.register('next_inject', function(point) {
|
|||||||
.join('');
|
.join('');
|
||||||
});
|
});
|
||||||
|
|
||||||
hexo.extend.helper.register('next_js', function(file, pjax = false) {
|
hexo.extend.helper.register('next_js', function(file, {
|
||||||
|
pjax = false,
|
||||||
|
module = false
|
||||||
|
} = {}) {
|
||||||
const { next_version } = this;
|
const { next_version } = this;
|
||||||
const { internal, custom_cdn_url } = this.theme.vendors;
|
const { internal, custom_cdn_url } = this.theme.vendors;
|
||||||
const links = getVendors({
|
const links = getVendors({
|
||||||
@ -29,7 +32,7 @@ hexo.extend.helper.register('next_js', function(file, pjax = false) {
|
|||||||
custom : custom_cdn_url
|
custom : custom_cdn_url
|
||||||
});
|
});
|
||||||
const src = links[internal] || links.local;
|
const src = links[internal] || links.local;
|
||||||
return `<script ${pjax ? 'data-pjax ' : ''}src="${src}"></script>`;
|
return `<script ${pjax ? 'data-pjax ' : ''}${module ? 'type="module" ' : ''}src="${src}"></script>`;
|
||||||
});
|
});
|
||||||
|
|
||||||
hexo.extend.helper.register('next_vendors', function(name) {
|
hexo.extend.helper.register('next_vendors', function(name) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user