chore: improve nav active state checking
This commit is contained in:
parent
3cff5d47e6
commit
f39f5ee2ff
3 changed files with 9 additions and 3 deletions
|
@ -37,6 +37,12 @@ export default {
|
|||
},
|
||||
replaceQuotes: (string) => string.replace(/"/g, "'"),
|
||||
|
||||
// navigation
|
||||
isLinkActive: (category, page) => {
|
||||
const normalizedPage = page.includes('.html') ? page.replace('.html', '/') : page
|
||||
return !!normalizedPage && normalizedPage.includes(category) && !/\d+/.test(normalizedPage);
|
||||
},
|
||||
|
||||
// analytics
|
||||
getPopularPosts: (posts, analytics) => {
|
||||
return posts
|
||||
|
|
Reference in a new issue