diff --git a/layout/_partials/head/head-unique.njk b/layout/_partials/head/head-unique.njk index 7aa8308..5424909 100644 --- a/layout/_partials/head/head-unique.njk +++ b/layout/_partials/head/head-unique.njk @@ -1,6 +1,11 @@ {{ open_graph() }} -{{ canonical() }} +{# https://github.com/theme-next/hexo-theme-next/issues/866 #} +{%- set canonical = url | replace(r/index\.html$/, '') %} +{%- if not config.permalink.endsWith('.html') %} + {%- set canonical = canonical | replace(r/\.html$/, '') %} +{%- endif %} + {# Exports some front-matter variables to Front-End #} diff --git a/layout/_partials/page/breadcrumb.njk b/layout/_partials/page/breadcrumb.njk index 267617f..4405b65 100644 --- a/layout/_partials/page/breadcrumb.njk +++ b/layout/_partials/page/breadcrumb.njk @@ -1,13 +1,11 @@ {%- set paths = page.path.split('/') %} {%- set count = paths.length %} {%- if count > 2 %} - {%- set current = 0 %} {%- set link = '' %}