mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +02:00
chore: update detail
This commit is contained in:
parent
91d27dd2ba
commit
ca1abd28c1
10 changed files with 63 additions and 61 deletions
|
@ -3,15 +3,14 @@ import { getNextLangUrl, getPostNextLangUrl } from '@/i18n/lang'
|
|||
import { isPostPage } from '@/i18n/path'
|
||||
|
||||
interface Props {
|
||||
supportedLangs?: string[] // 文章支持的语言列表
|
||||
supportedLangs: string[]
|
||||
}
|
||||
|
||||
const { supportedLangs = [] } = Astro.props
|
||||
const { supportedLangs } = Astro.props
|
||||
const currentPath = Astro.url.pathname
|
||||
const isPost = isPostPage(currentPath)
|
||||
|
||||
// 根据页面类型选择不同的URL获取函数
|
||||
const nextUrl = isPost && supportedLangs.length > 0
|
||||
const nextUrl = isPost
|
||||
? getPostNextLangUrl(currentPath, supportedLangs)
|
||||
: getNextLangUrl(currentPath)
|
||||
---
|
||||
|
@ -26,7 +25,8 @@ const nextUrl = isPost && supportedLangs.length > 0
|
|||
viewBox="0 0 24 24"
|
||||
aria-hidden="true"
|
||||
class="h-full w-full"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path d="M19 21 12.3 2h-1L4.7 21l-2.5.2v.8h6.3v-.8L5.7 21l2-5.9h7.5l2 5.9-3.3.2v.8h7.9v-.8zM8 14.3l3.4-10.1 3.5 10.1z" fill="currentColor" />
|
||||
<path d="M19 21 12.3 2h-1L4.7 21l-2.5.2v.8h6.3v-.8L5.7 21l2-5.9h7.5l2 5.9-3.3.2v.8h7.9v-.8zM8 14.3l3.4-10.1 3.5 10.1z" />
|
||||
</svg>
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue