Skip to content

Commit

Permalink
Migrate to Nunjucks [0] (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Oct 17, 2019
1 parent ee28652 commit 230b57d
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions layout/_macro/post-collapse.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro render(posts) %}
{%- for post in posts %}
{%- for post in posts.toArray() %}

{%- set current_year %}
{%- set year = date(post.date, 'YYYY') %}
Expand Down Expand Up @@ -29,7 +29,7 @@
{{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url'}) }}
{% else %}
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
<span itemprop="name">{{ post.title | default(__('post.untitled')) }}</span>
<span itemprop="name">{{ post.title or __('post.untitled') }}</span>
</a>
{%- endif %}
</{%- if theme.seo %}h3{% else %}h2{%- endif %}>
Expand Down
22 changes: 12 additions & 10 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% macro render(post, is_index) %}
{##################}
{### POST BLOCK ###}
{##################}
<article itemscope itemtype="http://schema.org/Article" class="post-block {% if is_index %}home{% endif %}" lang="{{ post.lang or post.language or config.language }}">
<link itemprop="mainEntityOfPage" href="{{ config.url }}{{ url_for(post.path) }}">

<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="{{ url_for(theme.avatar.url or theme.images + '/avatar.gif') }}">
<meta itemprop="name" content="{{ author }}">
<meta itemprop="description" content="{{ description }}">
<meta itemprop="image" content="{{ url_for( theme.avatar.url | default(theme.images + '/avatar.gif') ) }}">
</span>

<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
Expand All @@ -33,7 +34,7 @@
<i class="fa fa-thumb-tack"></i>
</span>
{%- endif %}
{{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: 'url'}) }}
{{ next_url(post.path, post.title or __('post.untitled'), {class: 'post-title-link', itemprop: 'url'}) }}
{%- else %}
{{- post.title }}
{% include '../_partials/post-edit.swig' %}
Expand Down Expand Up @@ -83,7 +84,7 @@
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">{{ __('post.in') }}</span>
{%- for cat in post.categories %}
{%- for cat in post.categories.toArray() %}
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="{{ url_for(cat.path) }}" itemprop="url" rel="index">
<span itemprop="name">{{ cat.name }}</span>
Expand Down Expand Up @@ -173,7 +174,7 @@
{%- if post.photos and post.photos.length %}
<div class="post-gallery" itemscope itemtype="http://schema.org/ImageGallery">
{%- set COLUMN_NUMBER = 3 %}
{%- for photo in post.photos %}
{%- for photo in post.photos.toArray() %}
{%- if loop.index0 % COLUMN_NUMBER === 0 %}<div class="post-gallery-row">{%- endif %}
<img src="{{ url_for(photo) }}" itemprop="contentUrl">
{%- if loop.index0 % COLUMN_NUMBER === 2 %}</div>{%- endif %}
Expand Down Expand Up @@ -220,14 +221,14 @@
{#####################}

{%- if theme.related_posts.enable and (theme.related_posts.display_in_home or not is_index) %}
{% include '../_partials/post/post-related.swig' with { post: post } %}
{% include '../_partials/post/post-related.swig' %}
{%- endif %}

{%- if not is_index %}
{{- next_inject('postBodyEnd') }}

{%- if theme.wechat_subscriber.enable %}
{{ partial('../_partials/post/wechat-subscriber.swig', {}, {cache: theme.cache.enable}) }}
{{ partial('_partials/post/wechat-subscriber.swig', {}, {cache: theme.cache.enable}) }}
{%- endif %}

{%- if post.reward === undefined and theme.reward_settings.enable %}
Expand All @@ -236,11 +237,11 @@
{%- set reward_able = post.reward %}
{%- endif %}
{%- if reward_able %}
{{ partial('../_partials/post/post-reward.swig', {}, {cache: theme.cache.enable}) }}
{{ partial('_partials/post/post-reward.swig', {}, {cache: theme.cache.enable}) }}
{%- endif %}

{%- if theme.creative_commons.license and theme.creative_commons.post %}
{% include '../_partials/post/post-copyright.swig' with { post: post } %}
{% include '../_partials/post/post-copyright.swig' %}
{%- endif %}

<footer class="post-footer">
Expand All @@ -251,13 +252,13 @@
{%- set tag_indicate = '#' %}
{%- endif %}
<div class="post-tags">
{%- for tag in post.tags %}
{%- for tag in post.tags.toArray() %}
<a href="{{ url_for(tag.path) }}" rel="tag">{{ tag_indicate }} {{ tag.name }}</a>
{%- endfor %}
</div>
{%- endif %}

{{ partial('../_partials/post/post-footer.swig', {}, {cache: theme.cache.enable}) }}
{{ partial('_partials/post/post-footer.swig', {}, {cache: theme.cache.enable}) }}

{%- if post.prev or post.next %}
<div class="post-nav">
Expand Down Expand Up @@ -290,3 +291,4 @@
{######################}
{### END POST BLOCK ###}
{######################}
{% endmacro %}
4 changes: 2 additions & 2 deletions layout/_macro/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

{%- set display_toc = theme.toc.enable and display_toc %}
{%- if display_toc %}
{%- set next_toc_number = page.toc_number | default(theme.toc.number) %}
{%- set next_toc_max_depth = page.toc_max_depth | default(theme.toc.max_depth) | default(6) %}
{%- set next_toc_number = page.toc_number or theme.toc.number %}
{%- set next_toc_max_depth = page.toc_max_depth or theme.toc.max_depth or 6 %}
{%- set toc = toc(page.content, { "class": "nav", list_number: next_toc_number, max_depth: next_toc_max_depth }) %}
{%- set display_toc = toc.length > 1 and display_toc %}
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/footer.swig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{%- endif %}

<div class="copyright">
{%- set current = date(Date.now(), "YYYY") %}
{%- set current = date(Date.now(), 'YYYY') %}
&copy; {% if theme.footer.since and theme.footer.since != current %}{{ theme.footer.since }} – {% endif %}
<span itemprop="copyrightYear">{{ current }}</span>
<span class="with-love">
Expand Down
8 changes: 4 additions & 4 deletions layout/_partials/head/head.swig
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@

{{ next_font() }}

{%- set font_awesome_uri = theme.vendors.fontawesome | default(next_vendors('font-awesome/css/font-awesome.min.css?v=4.7.0')) %}
{%- set font_awesome_uri = theme.vendors.fontawesome or next_vendors('font-awesome/css/font-awesome.min.css?v=4.7.0') %}
<link rel="stylesheet" href="{{ font_awesome_uri }}">

{%- if theme.fancybox %}
{%- set fancybox_css_uri = theme.vendors.fancybox_css | default(next_vendors('//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css')) %}
{%- set fancybox_css_uri = theme.vendors.fancybox_css or next_vendors('//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css') %}
<link rel="stylesheet" href="{{ fancybox_css_uri }}">
{%- endif %}

{%- if theme.pace.enable %}
{%- set pace_css_uri = theme.vendors.pace_css | default(next_vendors('pace/pace-theme-' + theme.pace.theme + '.min.css?v=1.0.2')) %}
{%- set pace_js_uri = theme.vendors.pace | default(next_vendors('pace/pace.min.js?v=1.0.2')) %}
{%- set pace_css_uri = theme.vendors.pace_css or next_vendors('pace/pace-theme-' + theme.pace.theme + '.min.css?v=1.0.2') %}
{%- set pace_js_uri = theme.vendors.pace or next_vendors('pace/pace.min.js?v=1.0.2') %}
<link rel="stylesheet" href="{{ pace_css_uri }}">
<script src="{{ pace_js_uri }}"></script>
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion layout/_partials/header/menu-item.swig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{%- set menuText = __('menu.' + name) | replace('menu.', '') %}
{%- if theme.menu_settings.icons %}
{%- set menuIcon = '<i class="fa fa-fw fa-' + value.split('||')[1] | trim | default('question-circle') + '"></i>' %}
{%- set menuIcon = '<i class="fa fa-fw fa-' + value.split('||')[1] | trim + '"></i>' %}
{%- endif %}

{%- set menuBadge = '' %}
Expand Down
6 changes: 3 additions & 3 deletions layout/_partials/post/post-copyright.swig
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>{{ __('post.copyright.author') + __('symbol.colon') }} </strong>
{{- post.author or author }}
{{- page.author or author }}
</li>
<li class="post-copyright-link">
<strong>{{ __('post.copyright.link') + __('symbol.colon') }}</strong>
{%- set postURL = post.url or post.permalink %}
{{ next_url(postURL, postURL, {title: post.title}) }}
{%- set postURL = page.url or page.permalink %}
{{ next_url(postURL, postURL, {title: page.title}) }}
</li>
<li class="post-copyright-license">
<strong>{{ __('post.copyright.license_title') + __('symbol.colon') }} </strong>
Expand Down
4 changes: 2 additions & 2 deletions layout/_partials/post/post-related.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%- set popular_posts = popular_posts_json(theme.related_posts.params, post) %}
{%- set popular_posts = popular_posts_json(theme.related_posts.params, page) %}
{%- if popular_posts.json and popular_posts.json.length > 0 %}
<div class="popular-posts-header">{{ theme.related_posts.title | default(__('post.related_posts')) }}</div>
<div class="popular-posts-header">{{ theme.related_posts.title or __('post.related_posts') }}</div>
<ul class="popular-posts">
{%- for popular_post in popular_posts.json %}
<li class="popular-posts-item">
Expand Down
11 changes: 4 additions & 7 deletions layout/_partials/sidebar/site-overview.swig
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
{%- if theme.avatar.url %}
<img class="site-author-image" itemprop="image"
src="{{ url_for( theme.avatar.url | default(theme.images + '/avatar.gif') ) }}"
alt="{{ author }}">
{%- endif %}
<img class="site-author-image" itemprop="image" alt="{{ author }}"
src="{{ url_for(theme.avatar.url or theme.images + '/avatar.gif') }}">
<p class="site-author-name" itemprop="name">{{ author }}</p>
<div class="site-description" itemprop="description">{{ description }}</div>
</div>
Expand Down Expand Up @@ -92,7 +89,7 @@
{%- set sidebarText = name %}
{%- endif %}
{%- if theme.social_icons.enable %}
{%- set sidebarIcon = '<i class="fa fa-fw fa-' + link.split('||')[1] | trim | default('globe') + '"></i>' %}
{%- set sidebarIcon = '<i class="fa fa-fw fa-' + link.split('||')[1] | trim + '"></i>' %}
{%- endif %}
{{ next_url(sidebarURL, sidebarIcon + sidebarText, {title: name + ' &rarr; ' + sidebarURL}) }}
</span>
Expand All @@ -118,7 +115,7 @@
{%- if theme.links %}
<div class="links-of-blogroll motion-element">
<div class="links-of-blogroll-title">
<i class="fa fa-fw fa-{{ theme.links_settings.icon | default('link') | lower }}"></i>
<i class="fa fa-fw fa-{{ (theme.links_settings.icon or 'link') | lower }}"></i>
{{ theme.links_settings.title }}
</div>
<ul class="links-of-blogroll-list">
Expand Down
2 changes: 1 addition & 1 deletion layout/_scripts/schemes/gemini.swig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% include 'pisces.swig' %}
{{- next_js('schemes/pisces.js') }}
2 changes: 1 addition & 1 deletion layout/_scripts/schemes/mist.swig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% include 'muse.swig' %}
{{- next_js('schemes/muse.js') }}
8 changes: 4 additions & 4 deletions layout/_scripts/three.swig
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{%- if theme.three.enable %}
{%- set three_uri = theme.vendors.three | default(next_vendors('three/three.min.js')) %}
{%- set three_uri = theme.vendors.three or next_vendors('three/three.min.js') %}
<script defer src="{{ three_uri }}"></script>
{%- if theme.three.three_waves %}
{%- set waves_uri = theme.vendors.three_waves | default(next_vendors('three/three-waves.min.js')) %}
{%- set waves_uri = theme.vendors.three_waves or next_vendors('three/three-waves.min.js') %}
<script defer src="{{ waves_uri }}"></script>
{%- endif %}
{%- if theme.three.canvas_lines %}
{%- set lines_uri = theme.vendors.canvas_lines | default(next_vendors('three/canvas_lines.min.js')) %}
{%- set lines_uri = theme.vendors.canvas_lines or next_vendors('three/canvas_lines.min.js') %}
<script defer src="{{ lines_uri }}"></script>
{%- endif %}
{%- if theme.three.canvas_sphere %}
{%- set sphere_uri = theme.vendors.canvas_sphere | default(next_vendors('three/canvas_sphere.min.js')) %}
{%- set sphere_uri = theme.vendors.canvas_sphere or next_vendors('three/canvas_sphere.min.js') %}
<script defer src="{{ sphere_uri }}"></script>
{%- endif %}
{%- endif %}
6 changes: 3 additions & 3 deletions layout/_scripts/vendors.swig
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@

{%- if theme.canvas_nest.enable %}
{%- if theme.canvas_nest.onmobile %}
{%- set canvas_nest_uri = theme.vendors.canvas_nest | default(next_vendors('canvas-nest/canvas-nest.min.js')) %}
{%- set canvas_nest_uri = theme.vendors.canvas_nest or next_vendors('canvas-nest/canvas-nest.min.js') %}
{% else %}
{%- set canvas_nest_uri = theme.vendors.canvas_nest_nomobile | default(next_vendors('canvas-nest/canvas-nest-nomobile.min.js')) %}
{%- set canvas_nest_uri = theme.vendors.canvas_nest_nomobile or next_vendors('canvas-nest/canvas-nest-nomobile.min.js') %}
{%- endif %}
<script color='{{ theme.canvas_nest.color }}' opacity='{{ theme.canvas_nest.opacity }}' zIndex='{{ theme.canvas_nest.zIndex }}' count='{{ theme.canvas_nest.count }}' src="{{ canvas_nest_uri }}"></script>
{%- endif %}

{%- if theme.canvas_ribbon.enable %}
{%- set canvas_ribbon_uri = theme.vendors.canvas_ribbon | default(next_vendors('canvas-ribbon/canvas-ribbon.js')) %}
{%- set canvas_ribbon_uri = theme.vendors.canvas_ribbon or next_vendors('canvas-ribbon/canvas-ribbon.js') %}
<script size="{{ theme.canvas_ribbon.size }}" alpha="{{ theme.canvas_ribbon.alpha }}" zIndex="{{ theme.canvas_ribbon.zIndex }}" src="{{ canvas_ribbon_uri }}"></script>
{%- endif %}

Expand Down
2 changes: 0 additions & 2 deletions layout/_third-party/chat/index.swig

This file was deleted.

4 changes: 2 additions & 2 deletions layout/_third-party/comments/disqusjs.swig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{%- if page.comments %}
{%- set disqusjs_css_uri = theme.vendors.disqusjs_css | default('//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css') %}
{%- set disqusjs_css_uri = theme.vendors.disqusjs_css or '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css' %}
<link rel="stylesheet" href="{{ disqusjs_css_uri }}">

{%- set disqusjs_js_uri = theme.vendors.disqusjs_js | default('//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js') %}
{%- set disqusjs_js_uri = theme.vendors.disqusjs_js or '//cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js' %}

<script>
NexT.utils.getScript('{{ disqusjs_js_uri }}', () => {
Expand Down
4 changes: 2 additions & 2 deletions layout/_third-party/comments/gitalk.swig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{%- if page.comments %}
{%- set gitalk_css_uri = theme.vendors.gitalk_css | default('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css') %}
{%- set gitalk_css_uri = theme.vendors.gitalk_css or '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css' %}
<link rel="stylesheet" href="{{ gitalk_css_uri }}">

{%- set gitalk_js_uri = theme.vendors.gitalk_js | default('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js') %}
{%- set gitalk_js_uri = theme.vendors.gitalk_js or '//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js' %}

<script>
NexT.utils.getScript('{{ gitalk_js_uri }}', () => {
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/comments/valine.swig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set valine_uri = theme.vendors.valine | default('//unpkg.com/valine/dist/Valine.min.js') %}
{%- set valine_uri = theme.vendors.valine or '//unpkg.com/valine/dist/Valine.min.js' %}

<script>
NexT.utils.getScript('{{ valine_uri }}', () => {
Expand Down
16 changes: 13 additions & 3 deletions layout/_third-party/index.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
{% include 'facebook-sdk.swig' %}
{% include 'rating.swig' %}

{% include 'search/index.swig' %}
{% include 'chat/index.swig' %}
{% include 'tags/index.swig' %}
{%- if theme.algolia_search.enable %}
{% include 'search/algolia-search.swig' %}
{% elif theme.swiftype_key %}
{% include 'search/swiftype.swig' %}
{% elif theme.local_search.enable %}
{% include 'search/localsearch.swig' %}
{%- endif %}

{% include 'chat/chatra.swig' %}
{% include 'chat/tidio.swig' %}

{% include 'tags/pdf.swig' %}
{% include 'tags/mermaid.swig' %}
2 changes: 1 addition & 1 deletion layout/_third-party/math/index.swig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{# At home, check if there has `mathjax: true` post #}
{%- if is_home() and theme.math.per_page %}
{%- for post in page.posts %}
{%- for post in page.posts.toArray() %}
{%- if post.mathjax and not is_index_has_math %}
{%- set is_index_has_math = true %}
{%- endif %}
Expand Down
6 changes: 3 additions & 3 deletions layout/_third-party/math/katex.swig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{%- set katex_uri = theme.vendors.katex | default('//cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css') %}
{%- set katex_uri = theme.vendors.katex or '//cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css' %}
<link rel="stylesheet" href="{{ katex_uri }}">
{%- if theme.math.katex.copy_tex %}
{%- set copy_tex_js_uri = theme.vendors.copy_tex_js | default('//cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js') %}
{%- set copy_tex_css_uri = theme.vendors.copy_tex_css | default('//cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css') %}
{%- set copy_tex_js_uri = theme.vendors.copy_tex_js or '//cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js' %}
{%- set copy_tex_css_uri = theme.vendors.copy_tex_css or '//cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css' %}
<script src="{{ copy_tex_js_uri }}"></script>
<link rel="stylesheet" href="{{ copy_tex_css_uri }}">
{%- endif %}
4 changes: 2 additions & 2 deletions layout/_third-party/math/mathjax.swig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set mhchem_uri = theme.vendors.mhchem | default('//cdn.jsdelivr.net/npm/mathjax-mhchem@3') %}
{%- set mhchem_uri = theme.vendors.mhchem or '//cdn.jsdelivr.net/npm/mathjax-mhchem@3' %}
<script type="text/x-mathjax-config">
{%- if theme.math.mathjax.mhchem %}
MathJax.Ajax.config.path['mhchem'] = '{{ mhchem_uri }}';
Expand Down Expand Up @@ -45,7 +45,7 @@
}
});
</script>
{%- set mathjax_uri = theme.vendors.mathjax | default('//cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML') %}
{%- set mathjax_uri = theme.vendors.mathjax or '//cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML' %}
<script>
NexT.utils.getScript('{{ mathjax_uri }}', () => {
MathJax.Hub.Typeset();
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/quicklink.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- if theme.quicklink.enable %}
{%- set quicklink_uri = theme.vendors.quicklink | default(next_vendors('//cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js')) %}
{%- set quicklink_uri = theme.vendors.quicklink or next_vendors('//cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js') %}

{%- if is_home() %}
{%- if theme.quicklink.home %}
Expand Down
4 changes: 2 additions & 2 deletions layout/_third-party/search/algolia-search.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- set algolia_instant_css_uri = theme.vendors.algolia_instant_css | default(next_vendors('//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.css')) %}
{%- set algolia_instant_js_uri = theme.vendors.algolia_instant_js | default(next_vendors('//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.js')) %}
{%- set algolia_instant_css_uri = theme.vendors.algolia_instant_css or next_vendors('//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.css') %}
{%- set algolia_instant_js_uri = theme.vendors.algolia_instant_js or next_vendors('//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.js') %}
<link rel="stylesheet" href="{{ algolia_instant_css_uri }}">
<script src="{{ algolia_instant_js_uri }}"></script>

Expand Down
7 changes: 0 additions & 7 deletions layout/_third-party/search/index.swig

This file was deleted.

2 changes: 0 additions & 2 deletions layout/_third-party/tags/index.swig

This file was deleted.

2 changes: 1 addition & 1 deletion layout/_third-party/tags/mermaid.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- if theme.mermaid.enable %}
{%- set mermaid_uri = theme.vendors.mermaid | default('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js') %}
{%- set mermaid_uri = theme.vendors.mermaid or '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js' %}
<script{{ pjax }}>
if (document.querySelectorAll('pre.mermaid').length) {
NexT.utils.getScript('{{ mermaid_uri }}', () => {
Expand Down
2 changes: 1 addition & 1 deletion layout/_third-party/tags/pdf.swig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{%- if theme.pdf.enable %}
{%- set pdfobject_uri = theme.vendors.pdfobject | default('//cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js') %}
{%- set pdfobject_uri = theme.vendors.pdfobject or '//cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js' %}
<script{{ pjax }}>
if (document.querySelectorAll('div.pdf').length) {
NexT.utils.getScript('{{ pdfobject_uri }}', () => {
Expand Down
Loading

0 comments on commit 230b57d

Please sign in to comment.