mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-17 12:01:33 +02:00
refactor: optimize multilingual article routing logic, modify slug to abbrlink
This commit is contained in:
parent
16491dae50
commit
e5165dd740
16 changed files with 673 additions and 133 deletions
|
@ -21,7 +21,7 @@ const postsByYear = await getPostsByYear(lang)
|
|||
<ul>
|
||||
{pinnedPosts.map(post => (
|
||||
<li>
|
||||
<a href={`/${lang}/posts/${post.data.slug || post.slug}/`}>
|
||||
<a href={`/${lang}/posts/${post.data.abbrlink || post.slug}/`}>
|
||||
{post.data.title}
|
||||
<time class="block lg:inline lg:before:content-['_']">
|
||||
{post.data.published.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit' }).replace('/', '-')}
|
||||
|
@ -45,7 +45,7 @@ const postsByYear = await getPostsByYear(lang)
|
|||
// Single Post
|
||||
<li class="mt-6">
|
||||
{/* Post Title */}
|
||||
<a href={`/${lang}/posts/${post.data.slug || post.slug}`}>{post.data.title}</a>
|
||||
<a href={`/${lang}/posts/${post.data.abbrlink || post.slug}/`}>{post.data.title}</a>
|
||||
{/* Post Date */}
|
||||
<time class="block text-5.6 leading-7 font-navbar opacity-30 lg:inline lg:before:content-['_']">
|
||||
{post.data.published.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit' }).replace('/', '-')}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue