Fix id conflict with markdown headerlink

This commit is contained in:
Mimi 2020-07-03 11:08:33 +08:00
parent ab2cbd4157
commit 7f3e4b16c1
4 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@
{{ partial('_third-party/index.njk', {}, {cache: theme.cache.enable}) }} {{ partial('_third-party/index.njk', {}, {cache: theme.cache.enable}) }}
{%- if theme.pjax %} {%- if theme.pjax %}
<div id="pjax"> <div class="pjax">
{%- endif %} {%- endif %}
{% include '_third-party/math/index.njk' %} {% include '_third-party/math/index.njk' %}
{% include '_third-party/quicklink.njk' %} {% include '_third-party/quicklink.njk' %}

View File

@ -3,7 +3,7 @@
{{ canonical() }} {{ canonical() }}
{# Exports some front-matter variables to Front-End #} {# Exports some front-matter variables to Front-End #}
<script{{ pjax }} id="page-configurations"> <script{{ pjax }} class="page-configurations">
// https://hexo.io/docs/variables.html // https://hexo.io/docs/variables.html
CONFIG.page = { CONFIG.page = {
sidebar: {{ page.sidebar | safedump }}, sidebar: {{ page.sidebar | safedump }},

View File

@ -2,11 +2,11 @@
var pjax = new Pjax({ var pjax = new Pjax({
selectors: [ selectors: [
'head title', 'head title',
'#page-configurations', '.page-configurations',
'.main-inner', '.main-inner',
'.post-toc-wrap', '.post-toc-wrap',
'.languages', '.languages',
'#pjax' '.pjax'
], ],
analytics: false, analytics: false,
cacheBust: false, cacheBust: false,
@ -14,7 +14,7 @@ var pjax = new Pjax({
}); });
document.addEventListener('pjax:success', () => { document.addEventListener('pjax:success', () => {
pjax.executeScripts(document.querySelectorAll('script[data-pjax], #pjax script')); pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
NexT.boot.refresh(); NexT.boot.refresh();
// Define Motion Sequence & Bootstrap Motion. // Define Motion Sequence & Bootstrap Motion.
if (CONFIG.motion.enable) { if (CONFIG.motion.enable) {

View File

@ -38,7 +38,7 @@ hexo.extend.helper.register('next_config', function() {
if (config.search) { if (config.search) {
exportConfig.path = config.search.path; exportConfig.path = config.search.path;
} }
return `<script id="hexo-configurations"> return `<script class="hexo-configurations">
var NexT = window.NexT || {}; var NexT = window.NexT || {};
var CONFIG = ${JSON.stringify(exportConfig)}; var CONFIG = ${JSON.stringify(exportConfig)};
</script>`; </script>`;