Skip to content

Commit

Permalink
fix: use array index instead of at()
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda committed Apr 7, 2024
1 parent 072fb9f commit 3c0a88f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ hexo.extend.helper.register('header_menu', function(className) {
hexo.extend.helper.register('canonical_url', function(lang) {
const slugs = this.page.path.split('/').filter(v => v !== '');

if (Object.keys(this.site.data.languages).includes(slugs && slugs.at(0))) {
if (Object.keys(this.site.data.languages).includes(slugs[0])) {
slugs.shift();
}
if (lang !== 'en') {
Expand Down

0 comments on commit 3c0a88f

Please sign in to comment.