From 7e730a73349bdf5e296e3b272f1c2a9f794dca7d Mon Sep 17 00:00:00 2001 From: Soitora <simon.mattila@protonmail.com> Date: Wed, 26 Jul 2023 01:53:30 +0200 Subject: [PATCH] Better head configuration --- website/src/.vitepress/config/head.ts | 1 - website/src/.vitepress/config/hooks/generateMeta.ts | 6 +++++- website/src/index.md | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/website/src/.vitepress/config/head.ts b/website/src/.vitepress/config/head.ts index 9ac16171..54d336a0 100644 --- a/website/src/.vitepress/config/head.ts +++ b/website/src/.vitepress/config/head.ts @@ -14,7 +14,6 @@ const head: HeadConfig[] = [ ["meta", { name: "twitter:card", content: "summary" }], ["meta", { name: "twitter:site", content: "@tachiyomiorg" }], ["meta", { name: "twitter:creator", content: "@tachiyomiorg" }], - ["meta", { name: "twitter:image", content: "/img/logo.png" }], ["meta", { property: "og:site_name", content: "Tachiyomi" }], [ diff --git a/website/src/.vitepress/config/hooks/generateMeta.ts b/website/src/.vitepress/config/hooks/generateMeta.ts index d7ef1ed4..5388e6bf 100644 --- a/website/src/.vitepress/config/hooks/generateMeta.ts +++ b/website/src/.vitepress/config/hooks/generateMeta.ts @@ -16,7 +16,11 @@ const generateMeta = (context: TransformContext, hostname: string) => { if (pageData.frontmatter.type) { head.push(["meta", { property: "og:type", content: pageData.frontmatter.type }]); } - if (pageData.frontmatter.title) { + if (pageData.frontmatter.customMetaTitle) { + head.push(["meta", { property: "og:title", content: pageData.frontmatter.customMetaTitle }]); + head.push(["meta", { name: "twitter:title", content: pageData.frontmatter.customMetaTitle }]); + head.push(["meta", { property: "og:site_name", content: "" }]); + } else { head.push(["meta", { property: "og:title", content: pageData.frontmatter.title }]); head.push(["meta", { name: "twitter:title", content: pageData.frontmatter.title }]); } diff --git a/website/src/index.md b/website/src/index.md index fc2bb8e2..a42e4f87 100644 --- a/website/src/index.md +++ b/website/src/index.md @@ -18,6 +18,8 @@ hero: text: Download link: /download +customMetaTitle: Tachiyomi + features: - title: Tracking details: Automatically keep track of your series with AniList, Bangumi, Kitsu, MangaUpdates, MyAnimeList, Shikimori, and more.