Skip to content

Commit

Permalink
✨ support setting keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
XiYang6666 committed May 30, 2024
1 parent 947d9a6 commit dbad45b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ NUXT_AVATAR_CACHE_TIME = 3600000

NUXT_LINKS = {"blog":"https://blog.example.com","forum":"https://forum.example.com"}
NUXT_SOCIALS = {"github":{"link":"https://github.com/","icon":"fa-brands fa-github"},"bilibili":{"link":"https://www.bilibili.com/","icon":"fa-brands fa-bilibili"},"email":{"link":"mailto:example@example.com","icon":"fa-solid fa-envelope"}}

NUXT_KEYWORDS = ["main page"]
4 changes: 3 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ const footer = useState(() => config.footer);
const links = useState(() => config.links as Record<string, string>);
const socials = useState(() => config.socials as Record<string, { link: string; icon: string }>);
const keywords = useState(() => config.keywords);
useHead({
title: config.title,
meta: [
{ name: "description", content: `${hitokoto.value}\n${description.value}` },
{ hid: "keywords", name: "keywords", content: "XiYang6666, main page, 个人主页" },
{ hid: "keywords", name: "keywords", content: keywords.value.join(", ") },
],
link: [
{
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export default defineNuxtConfig({
avatarCacheTime: 60 * 60 * 1000, // 1 hour
links: {},
socials: {},
keywords: ["main page"],
},
});

0 comments on commit dbad45b

Please sign in to comment.