+
随机存取
@@ -61,7 +55,7 @@ import useColorModeStore from '~/stores/colorModeStore';
@@ -70,17 +64,17 @@ import useColorModeStore from '~/stores/colorModeStore';
-
{
- useColorModeStore().toggleColorMode();
- }
- ">swap Theme
-
-
-
+
+
+ © 2025 随机存取. 由Lichx制作
+
+
+ 蒙ICP备2025022865号
+
+
diff --git a/pages/index/archive/components/TimeLine.vue b/pages/index/archive/components/TimeLine.vue
new file mode 100644
index 0000000..50173d9
--- /dev/null
+++ b/pages/index/archive/components/TimeLine.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+ {{ getYear(article) }}
+
+
+ {{ article.category }}
+
+
+
+
+ {{ dateFormatToDate(article.published_at) }}
+
+
+ {{ article.title }}
+
+
+
+
+
+
+
diff --git a/pages/index/archive/index.vue b/pages/index/archive/index.vue
index 96c0baf..ad46b73 100644
--- a/pages/index/archive/index.vue
+++ b/pages/index/archive/index.vue
@@ -1,11 +1,39 @@
-
-
+
\ No newline at end of file
+
diff --git a/pages/index/article/[articleID]/components/ArticleHeader.vue b/pages/index/article/[articleID]/components/ArticleHeader.vue
new file mode 100644
index 0000000..a94c68f
--- /dev/null
+++ b/pages/index/article/[articleID]/components/ArticleHeader.vue
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+ {{ props.article.title }}
+
+
+
+
+
+
+
+
+
+
+ {{ dateFormat(props.article.published_at) }}
+
+
+
+
+
+
+ {{ props.article.category }}
+
+
+
+
+
+
+
+
+
+ {{ props.article.word_count }}字
+
+
+
+
+
+
+ {{ getCostTime(props.article.word_count) }}
+
+
+
+
+
+
+
+
{{ dateFormat(props.article.created_at) }}
+
+
+
+
+
+
+ {{ dateFormat(props.article.updated_at[props.article.updated_at.length - 1]) }}
+
+
+
+
+
+
+ {{ '第' + index + '次更新' + dateFormat(date) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/index/article/[articleID]/index.vue b/pages/index/article/[articleID]/index.vue
index d1fe6f5..e87958a 100644
--- a/pages/index/article/[articleID]/index.vue
+++ b/pages/index/article/[articleID]/index.vue
@@ -1,14 +1,34 @@
-{{useRoute().params.articleID}}
+
-
diff --git a/pages/index/article/index.vue b/pages/index/article/index.vue
deleted file mode 100644
index eb883b5..0000000
--- a/pages/index/article/index.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- Article
-
-
-
-
diff --git a/components/ArticleCard.vue b/pages/index/components/ArticleCard.vue
similarity index 59%
rename from components/ArticleCard.vue
rename to pages/index/components/ArticleCard.vue
index 9d852bf..2535336 100644
--- a/components/ArticleCard.vue
+++ b/pages/index/components/ArticleCard.vue
@@ -1,34 +1,14 @@
-
+
{{ props.article.title }}
-
+
-
- {{ dateFormat(props.article.published_at) }}
+
+ {{ dateFormat(props.article.published_at) }}
+
+
+
+
+
+
+ {{ props.article.category }}
-
+
{{ props.article.word_count }}字
-
+
{{ getCostTime(props.article.word_count) }}
@@ -98,14 +82,25 @@ function getCostTime(length: number | DataAnomaly) {
{{ props.article.description }}
-
+
+
+
+
@@ -134,15 +129,14 @@ function getCostTime(length: number | DataAnomaly) {
-
-
-
-
-
diff --git a/pages/index/components/RamblingCard.vue b/pages/index/components/RamblingCard.vue
new file mode 100644
index 0000000..03fb565
--- /dev/null
+++ b/pages/index/components/RamblingCard.vue
@@ -0,0 +1,176 @@
+
+
+
+
+
+ 絮语:{{ props.rambling.title }}
+
+
+
+
+
+
+ {{ dateFormat(props.rambling.published_at) }}
+
+
+
+
+
+
+ {{ props.rambling.category }}
+
+
+
+
+
+
+ {{ props.rambling.word_count }}字
+
+
+
+
+
+
+ {{ getCostTime(props.rambling.word_count) }}
+
+
+
+
+
+
+
+
+
+
{{ dateFormat(props.rambling.created_at) }}
+
+
+
+
+
+
+ {{ dateFormat(props.rambling.updated_at[props.rambling.updated_at.length - 1]) }}
+
+
+
+
+
+
+ {{ '第' + index + '次更新' + dateFormat(date) }}
+
+
+
+
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 7d9ce32..95591e0 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,57 +1,46 @@
-
-
-
-
diff --git a/types/ArticleMetaData.ts b/types/PostMetaData.ts
similarity index 78%
rename from types/ArticleMetaData.ts
rename to types/PostMetaData.ts
index ba3002a..0edd2c2 100644
--- a/types/ArticleMetaData.ts
+++ b/types/PostMetaData.ts
@@ -5,15 +5,17 @@ export enum DataAnomaly {
Invalid = 'DataInvalid',
}
-export type ArticleMetaData = {
+export type PostMetaData = {
id: string;
title: string;
description: string;
created_at: Date | DataAnomaly;
+ category: string;
published_at: Date | DataAnomaly;
draft: boolean;
updated_at: Date[] | DataAnomaly;
tags: string[];
+ type: string;
tech_stack: string[] | DataAnomaly;
tech_stack_percent: number[] | DataAnomaly;
tech_stack_icon_names: string[] | DataAnomaly;
@@ -37,8 +39,9 @@ function getDate(data: Record
, key: string): Date | DataAnomaly
return date;
}
-export function toArticleMetaDataType(src: unknown): ArticleMetaData {
+export function toMetaDataType(src: unknown): PostMetaData {
if (typeof src !== 'object' || src === null) {
+ console.log(src);
throw new TypeError('Expected an object');
}
const data = src as Record;
@@ -104,6 +107,8 @@ export function toArticleMetaDataType(src: unknown): ArticleMetaData {
id: String(data.id),
title: String(data.title),
description: String(data.description ?? ''),
+ category: String(data.category ?? '无'),
+ type: String(data.type ?? 'article'),
created_at: created_at,
published_at: published_at,
draft: Boolean(data.draft ?? false),
@@ -116,3 +121,26 @@ export function toArticleMetaDataType(src: unknown): ArticleMetaData {
word_count: wordCountResult,
};
}
+
+export const defaultMetaData = toMetaDataType({
+ id: 'default ID',
+ title: 'ApiFox / Postman 使用WebSocket连接SignalR进行测试需要注意的小问题',
+ description: 'default Description',
+ created_at: new Date('2025-01-01T00:00:00Z'), // 默认创建时间
+ published_at: new Date('2025-01-01T00:01:00Z'), // 默认发布时间
+ draft: true,
+ updated_at: [new Date('2025-01-01T00:02:00Z'), new Date('2025-01-01T00:03:00Z')], // 默认更新时间
+ tags: ['C#', 'TS', 'Windows Professional version with Webstorm 2025', 'Windows Professional version with Visual Studio 2022'],
+ tech_stack: new Map([
+ ['Vue', 5],
+ ['Nuxt', 3],
+ ['TypeScript', 4],
+ ['JavaScript', 2],
+ ['CSS', 1],
+ ['HTML', 1],
+ ['Node.js', 2],
+ ['Python', 3],
+ ['Java', 2],
+ ['C#', 1],
+ ]),
+});
diff --git a/utils/BreakpointsHelper.ts b/utils/BreakpointsHelper.ts
new file mode 100644
index 0000000..f47af44
--- /dev/null
+++ b/utils/BreakpointsHelper.ts
@@ -0,0 +1,5 @@
+import { useBreakpoints } from '@vueuse/core';
+import breakpoints from '~/configs/breakpoints';
+
+const breakpointsHelper = useBreakpoints(breakpoints);
+export default breakpointsHelper;