diff --git a/themes/empty/LayoutBase.js b/themes/empty/LayoutBase.js
index 9bdf2c57..ed2de109 100644
--- a/themes/empty/LayoutBase.js
+++ b/themes/empty/LayoutBase.js
@@ -1,7 +1,8 @@
import CommonHead from '@/components/CommonHead'
import Live2D from '@/components/Live2D'
import Link from 'next/link'
-
+import React from 'react'
+import BLOG from '@/blog.config'
/**
* 基础布局 采用左右两侧布局,移动端使用顶部导航栏
@@ -10,6 +11,9 @@ import Link from 'next/link'
*/
const LayoutBase = props => {
const { children, meta } = props
+ const d = new Date()
+ const currentYear = d.getFullYear()
+ const startYear = BLOG.SINCE && BLOG.SINCE !== currentYear && BLOG.SINCE + '-'
return (
@@ -19,12 +23,6 @@ const LayoutBase = props => {
首页
-
-
分类
-
-
-
标签
-
{/* 内容主体 */}
@@ -32,9 +30,23 @@ const LayoutBase = props => {
{children}
-
)
}
diff --git a/themes/empty/LayoutIndex.js b/themes/empty/LayoutIndex.js
index 39072ba2..817bcdfb 100644
--- a/themes/empty/LayoutIndex.js
+++ b/themes/empty/LayoutIndex.js
@@ -1,8 +1,20 @@
+import BLOG from '@/blog.config'
+import { useGlobal } from '@/lib/global'
import Link from 'next/link'
+import { useRouter } from 'next/router'
import LayoutBase from './LayoutBase'
export const LayoutIndex = props => {
- const { posts } = props
+ const { posts, postCount } = props
+
+ const { locale } = useGlobal()
+ const router = useRouter()
+ const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
+
+ const page = 1
+ const showNext = page < totalPage && posts.length === BLOG.POSTS_PER_PAGE && posts.length < postCount
+
+ const currentPage = +page
return (
{posts.map(p => (
@@ -13,6 +25,28 @@ export const LayoutIndex = props => {
{p.summary}
))}
+
+
)
}
diff --git a/themes/empty/LayoutPage.js b/themes/empty/LayoutPage.js
index 661a104b..2f5f795a 100644
--- a/themes/empty/LayoutPage.js
+++ b/themes/empty/LayoutPage.js
@@ -1,8 +1,52 @@
+import BLOG from '@/blog.config'
+import { useGlobal } from '@/lib/global'
+import Link from 'next/link'
+import { useRouter } from 'next/router'
import LayoutBase from './LayoutBase'
export const LayoutPage = (props) => {
const { page } = props
- return
- Page - {page}
-
+ const { posts, postCount } = props
+
+ const { locale } = useGlobal()
+ const router = useRouter()
+ const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
+
+ const showNext = page < totalPage && posts.length === BLOG.POSTS_PER_PAGE && posts.length < postCount
+
+ const currentPage = +page
+ return (
+
+ {posts.map(p => (
+
+ ))}
+
+
+
+ )
}