update
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
const siteConfig = {
|
import type { SiteConfig } from "~/types/nav";
|
||||||
|
|
||||||
|
const siteConfig: SiteConfig = {
|
||||||
siteMeta: {
|
siteMeta: {
|
||||||
title: "RhenCloud's Blog",
|
title: "RhenCloud's Blog",
|
||||||
description: "一个普普通通的技术博客,分享技术,记录日常,传递一些有趣的想法。",
|
description: "一个普普通通的技术博客,分享技术,记录日常,传递一些有趣的想法。",
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import TechInfo from "~/components/main/TechInfo.vue";
|
import TechInfo from "~/components/main/TechInfo.vue";
|
||||||
|
import siteConfig from "~/config";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { data: content } = await useAsyncData(route.path, () => queryCollection("about").first());
|
const { data: content } = await useAsyncData(route.path, () => queryCollection("about").first());
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: `About - ${siteConfig.siteMeta.title}`,
|
||||||
|
meta: [
|
||||||
|
{ name: "description", content: siteConfig.siteMeta.description },
|
||||||
|
{ name: "author", content: siteConfig.siteMeta.author },
|
||||||
|
],
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const formattedData = computed(() => {
|
|||||||
path: articles.path,
|
path: articles.path,
|
||||||
title: articles.title || "no-title available",
|
title: articles.title || "no-title available",
|
||||||
description: articles.description || "no-description available",
|
description: articles.description || "no-description available",
|
||||||
image: articles.image || "/blogs-img/blog.jpg",
|
image: articles.image || getRandomFallbackImage(),
|
||||||
alt: articles.alt || "no alter data available",
|
alt: articles.alt || "no alter data available",
|
||||||
date: articles.date || "not-date-available",
|
date: articles.date || "not-date-available",
|
||||||
tags: articles.tags || [],
|
tags: articles.tags || [],
|
||||||
@@ -39,7 +39,7 @@ const formattedData = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: category.value,
|
title: `Category: ${category.value}`,
|
||||||
meta: [
|
meta: [
|
||||||
{
|
{
|
||||||
name: "description",
|
name: "description",
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ const data = computed<BlogPost>(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: siteConfig.siteMeta.title || "",
|
title: `${data.value.title} - ${siteConfig.siteMeta.title}`,
|
||||||
meta: [
|
meta: [
|
||||||
{ name: "description", content: siteConfig.siteMeta.description },
|
{ name: "description", content: data.value.description },
|
||||||
{ name: "author", content: siteConfig.siteMeta.author },
|
{ name: "author", content: siteConfig.siteMeta.author },
|
||||||
],
|
],
|
||||||
link: [
|
link: [
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const formattedData = computed(() => {
|
|||||||
path: articles.path,
|
path: articles.path,
|
||||||
title: articles.title || "no-title available",
|
title: articles.title || "no-title available",
|
||||||
description: articles.description || "no-description available",
|
description: articles.description || "no-description available",
|
||||||
image: articles.image || "/blogs-img/blog.jpg",
|
image: articles.image || getRandomFallbackImage(),
|
||||||
alt: articles.alt || "no alter data available",
|
alt: articles.alt || "no alter data available",
|
||||||
date: formatDate(articles.date) || "not-date-available",
|
date: formatDate(articles.date) || "not-date-available",
|
||||||
tags: articles.tags || [],
|
tags: articles.tags || [],
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import siteConfig from "~/config";
|
|
||||||
|
|
||||||
const { data } = await useAsyncData("all-blog-post-by-tags", () =>
|
const { data } = await useAsyncData("all-blog-post-by-tags", () =>
|
||||||
queryCollection("content").select("path", "tags").where("published", "=", true).all(),
|
queryCollection("content").select("path", "tags").where("published", "=", true).all(),
|
||||||
);
|
);
|
||||||
@@ -20,7 +18,7 @@ data.value?.forEach((blog) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useHead({
|
useHead({
|
||||||
title: `${siteConfig.siteMeta.title} - Tags`,
|
title: "Tags",
|
||||||
meta: [
|
meta: [
|
||||||
{
|
{
|
||||||
name: "description",
|
name: "description",
|
||||||
|
|||||||
94
app/types/nav.ts
Normal file
94
app/types/nav.ts
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
export interface NavLink {
|
||||||
|
name: string;
|
||||||
|
path: string;
|
||||||
|
icon?: string;
|
||||||
|
children?: NavLink[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SiteMeta {
|
||||||
|
title: string;
|
||||||
|
description?: string;
|
||||||
|
keywords?: string[];
|
||||||
|
author?: string;
|
||||||
|
url?: string;
|
||||||
|
email?: string;
|
||||||
|
lang?: string;
|
||||||
|
favicon?: string;
|
||||||
|
startTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TypedOptions {
|
||||||
|
enable: boolean;
|
||||||
|
typeSpeed?: number;
|
||||||
|
backSpeed?: number;
|
||||||
|
loop?: boolean;
|
||||||
|
backDelay?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Hero {
|
||||||
|
title?: string;
|
||||||
|
description?: string | string[];
|
||||||
|
typed?: TypedOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Profile {
|
||||||
|
avatar?: string;
|
||||||
|
birthday?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SocialLink {
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LineInfo {
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
ping?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Theme {
|
||||||
|
background?: string;
|
||||||
|
backgroundMobile?: string;
|
||||||
|
color?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Footer {
|
||||||
|
beian?: string;
|
||||||
|
beianLink?: string;
|
||||||
|
customHtml?: string;
|
||||||
|
hitokoto?: {
|
||||||
|
enable: boolean;
|
||||||
|
type?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommentConfig {
|
||||||
|
twikoo?: {
|
||||||
|
enable?: boolean;
|
||||||
|
envId?: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UmamiConfig {
|
||||||
|
enable?: boolean;
|
||||||
|
scriptUrl?: string;
|
||||||
|
apiKey?: string;
|
||||||
|
websiteId?: string;
|
||||||
|
apiEndpoint?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SiteConfig {
|
||||||
|
siteMeta: SiteMeta;
|
||||||
|
hero: Hero;
|
||||||
|
profile: Profile;
|
||||||
|
socialLinks: SocialLink[];
|
||||||
|
navbar: {
|
||||||
|
links: NavLink[];
|
||||||
|
};
|
||||||
|
lines?: LineInfo[];
|
||||||
|
theme?: Theme;
|
||||||
|
footer?: Footer;
|
||||||
|
comment?: CommentConfig;
|
||||||
|
umami?: UmamiConfig;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user