diff --git a/layout/_partial/main/navbar/list_post.ejs b/layout/_partial/main/navbar/list_post.ejs index a0e5ecc..8dab20c 100644 --- a/layout/_partial/main/navbar/list_post.ejs +++ b/layout/_partial/main/navbar/list_post.ejs @@ -40,7 +40,9 @@ function layoutDiv() { if (theme['post-index']) { const obj = theme['post-index']; for (let key of Object.keys(obj)) { - if (full_url_for(page.path) == full_url_for(obj[key])) { + // 当 page 的末尾为 index.html 或者处于该 page 的某个子页面时也应该匹配 + // if (full_url_for(page.path) == full_url_for(obj[key])) { + if (full_url_for(page.path).startsWith(full_url_for(obj[key]))){ el += '' + key + ''; } else { el += '' + key + ''; @@ -54,4 +56,4 @@ function layoutDiv() { } %> -<%- layoutDiv() %> +<%- layoutDiv() %> \ No newline at end of file