chore: tweak

This commit is contained in:
pengzhanbo 2024-05-26 18:56:47 +08:00
parent 48c6113f77
commit a493edb48f
3 changed files with 9 additions and 13 deletions

View File

@ -107,7 +107,6 @@ export const zhNotes = definePlumeNotesConfig({
sidebar: [
{
text: '插件',
link: '/plugins/',
items: [
'caniuse',
'iconify',
@ -117,7 +116,7 @@ export const zhNotes = definePlumeNotesConfig({
{
text: 'plugin-netlify-functions',
dir: 'netlify-functions',
link: '/plugins/plugin-netlify-functions/',
link: '/plugin-netlify-functions/',
items: [
'介绍',
'使用',
@ -137,7 +136,6 @@ export const zhNotes = definePlumeNotesConfig({
{
text: '工具',
icon: 'tabler:tools',
link: '/tools/',
items: ['home-hero-tint-plate', 'caniuse'],
},
],

View File

@ -1,6 +0,0 @@
---
title: 测试文件
author: Plume Theme
createTime: 2024/05/26 02:11:27
permalink: /plugins/9kekfblc/
---

View File

@ -115,11 +115,11 @@ export function resolveAutoFrontmatterOptions(
return
const locale = resolveLocale(relativePath)
const notes = notesByLocale(locale)
const prefix = notesByLocale(locale)?.link || ''
const note = findNote(relativePath)
return pathJoin(
locale,
notes?.link || '',
prefix,
note?.link || getCurrentDirname(note?.dir, relativePath),
'/',
)
@ -160,9 +160,12 @@ export function resolveAutoFrontmatterOptions(
const sidebar = note?.sidebar
if (note && sidebar && sidebar !== 'auto') {
const res = resolveLinkBySidebar(sidebar, pathJoin(prefix, note.dir || ''))
const res = resolveLinkBySidebar(sidebar, pathJoin(notes?.dir || '', note.dir || ''))
const file = ensureLeadingSlash(relativePath)
res[file] && args.push(res[file])
if (res[file])
args.push(res[file])
else
res[path.dirname(file)] && args.push(res[path.dirname(file)])
}
return pathJoin(...args, nanoid(), '/')
@ -231,6 +234,7 @@ function SidebarLink(items: NotesSidebar | undefined, link: string, text: string
res[pathJoin(dir, 'index.md')] = link
res[pathJoin(dir, 'readme.md')] = link
}
res[dir] = link
}
else {
const { dir: subDir = '', link: subLink = '/', items: subItems, text: subText = '' } = item