diff --git a/src/components/Aside.astro b/src/components/Aside.astro
index 0eb6f26..db7816f 100644
--- a/src/components/Aside.astro
+++ b/src/components/Aside.astro
@@ -1,7 +1,7 @@
---
// 获取用户配置数据
import SITE_CONFIG from "../config";
-import { fmtDate } from "../utils/index";
+import { fmtTime } from "../utils/index";
const { Avatar, Author, Motto, WebSites } = SITE_CONFIG;
// 获取文章数据
import { getCategories, getTags, getRecommendArticles } from "../utils/getPostInfo";
@@ -78,7 +78,7 @@ import "../styles/components/Aside.less";
{(await i).title}
-
+
))
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
index 21f04c5..29cd8ab 100644
--- a/src/components/Footer.astro
+++ b/src/components/Footer.astro
@@ -1,18 +1,25 @@
---
// 静态图片
import { Image } from "astro:assets";
-// 格式化时间
-import { fmtDate } from "../utils/index";
-// 页面内容的元数据
-import SITE_CONFIG from "../config";
-const { CreateTime } = SITE_CONFIG;
// 基础 样式
import "../styles/Footer.less";
---
+
diff --git a/src/pages/article/[...article].astro b/src/pages/article/[...article].astro
index 24441ba..db0be91 100644
--- a/src/pages/article/[...article].astro
+++ b/src/pages/article/[...article].astro
@@ -1,5 +1,4 @@
---
-import { fmtDate } from "../../utils/index";
import { getDescription, fmtTime } from "../../utils/index";
import { type CollectionEntry, getCollection } from "astro:content";
import { render } from "astro:content";
@@ -39,11 +38,11 @@ import "../../styles/Article.less";
-
+
{Twikoo.envId && }
diff --git a/src/styles/Article.less b/src/styles/Article.less
index e9c0bc3..068e380 100644
--- a/src/styles/Article.less
+++ b/src/styles/Article.less
@@ -164,16 +164,22 @@ section.vh-container {
display: flex;
align-items: center;
gap: 1.18rem;
- font-size: 0.88rem;
+ font-size: 0.85rem;
&>.article-meta-item {
display: flex;
align-items: center;
- gap: 0.56rem;
+ gap: 0.38rem;
+ width: max-content;
&>svg {
+ flex-shrink: 0;
height: 0.86rem;
- width: 0.86rem;
+ width: auto;
+ }
+
+ &>time {
+ color: #9A9A9A;
}
}
}
diff --git a/src/styles/components/Copyrigh.less b/src/styles/components/Copyright.less
similarity index 100%
rename from src/styles/components/Copyrigh.less
rename to src/styles/components/Copyright.less
diff --git a/src/utils/index.ts b/src/utils/index.ts
index d5caff1..aa22639 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,8 +1,15 @@
import dayjs from "dayjs";
+import utc from "dayjs/plugin/utc.js";
+import timezone from "dayjs/plugin/timezone.js";
+dayjs.extend(utc);
+dayjs.extend(timezone);
+// 设置中文语言环境
+import 'dayjs/locale/zh-cn'
+dayjs.locale('zh-cn');
// 获取文章的描述
const getDescription = (post: any, num: number = 150) => (post.rendered ? post.rendered.html.replace(/<[^>]+>/g, "").replace(/\s+/g, "") : post.body.replace(/\n/g, "").replace(/#/g, "")).slice(0, num) || '暂无简介'
//处理时间
-const fmtTime = (time: any, fmt: string = 'MMMM D, YYYY') => dayjs(time).format(fmt)
+const fmtTime = (time: any, fmt: string = 'MMMM D, YYYY') => dayjs(time).tz('America/New_York').format(fmt)
// 处理日期
const fmtDate = (time: string | Date) => {
const now = dayjs();