- @if (categoryPrevNext.previousPost; as post) {
-
-
-
chevron_left
- 上一篇
+ @for (
+ categoryPrevNext of postCategoriesPrevNext();
+ track categoryPrevNext.category
+ ) {
+ @if (categoryPrevNext.previousPost || categoryPrevNext.nextPost) {
+
-
- }
-
-
- @if (categoryPrevNext.nextPost; as post) {
-
-
- 下一篇
-
chevron_right
+
+
+ @if (categoryPrevNext.previousPost; as post) {
+
+ chevron_left
+ 上一篇
+
+
+ }
+
+
+ @if (categoryPrevNext.nextPost; as post) {
+
+ 下一篇
+ chevron_right
+
+
+ }
+
-
-
- }
-
-
-
-
- } }
+
+ }
+ }
@@ -164,34 +160,30 @@ const findNextPost = (posts: PostMetaWithSlug[], target: MarkdownMeta) => {
class="blog-post-prev flex flex-col flex-[50%] items-start justify-start text-start"
>
@if (previousPost(); as post) {
-
-
- chevron_left
- 上一篇
-
-
-
+
+ chevron_left
+ 上一篇
+
+
}
@if (nextPost(); as post) {
-
-
- 下一篇
- chevron_right
-
-
-
+
+ 下一篇
+ chevron_right
+
+
}
@@ -228,24 +220,23 @@ const findNextPost = (posts: PostMetaWithSlug[], target: MarkdownMeta) => {