chore: test applink

pull/1/head
Zakhar Timoshenko 3 years ago
parent 911e4d3dcc
commit 2d12aac298

@ -7,6 +7,15 @@ function generateMeta(context: TransformContext, hostname: string) {
const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2")}` const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2")}`
head.push(['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }])
head.push(['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }])
head.push(['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap' }])
head.push(['link', { rel: 'icon', href: '/favicon.ico?v=2', sizes: 'any' }])
head.push(['link', { rel: 'icon', href: '/logo-compact.svg?v=2', type: 'image/svg+xml' }])
head.push(['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png?v=2' }])
head.push(['link', { rel: 'manifest', href: '/site.webmanifest' }])
head.push(["link", { rel: "canonical", href: url }]) head.push(["link", { rel: "canonical", href: url }])
head.push(["meta", { property: "og:url", content: url }]) head.push(["meta", { property: "og:url", content: url }])
head.push(["meta", { name: "twitter:url", content: url }]) head.push(["meta", { name: "twitter:url", content: url }])
@ -104,6 +113,12 @@ function generateMeta(context: TransformContext, hostname: string) {
}, },
]) ])
} }
if (pageData.filePath === "manga/index.md") {
head.push(["meta", { property: "al:android:url", content: "kotatsu://manga" }])
head.push(["meta", { property: "al:android:app_name", content: "Kotatsu" }])
head.push(["meta", { property: "al:android:package", content: "org.koitharu.kotatsu" }])
head.push(["script", {}, `window.location = "kotatsu://manga"`])
}
return head return head
} }

@ -9,7 +9,7 @@ import { slugify } from 'transliteration'
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
import { telegram } from '../../website/icons' import { telegram } from '../../website/icons'
import { tabsMarkdownPlugin } from "vitepress-plugin-tabs" import { tabsMarkdownPlugin } from "vitepress-plugin-tabs"
import pluginRewriteAll from 'vite-plugin-rewrite-all'; import pluginRewriteAll from 'vite-plugin-rewrite-all'
import shortcode_plugin from "markdown-it-shortcode-tag" import shortcode_plugin from "markdown-it-shortcode-tag"
import shortcodes from "./shortcodes" import shortcodes from "./shortcodes"
@ -56,21 +56,6 @@ export default defineConfigWithTheme<Theme.Config>({
}, },
}, },
head: [
['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap' }],
['link', { rel: 'icon', href: '/favicon.ico?v=2', sizes: 'any' }],
['link', { rel: 'icon', href: '/logo-compact.svg?v=2', type: 'image/svg+xml' }],
['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png?v=2' }],
['link', { rel: 'manifest', href: '/site.webmanifest' }],
["meta", { property: "al:android:url", content: "kotatsu://manga" }],
["meta", { property: "al:android:app_name", content: "Kotatsu" }],
["meta", { property: "al:android:package", content: "org.koitharu.kotatsu.debug" }]
],
themeConfig: { themeConfig: {
titleSeparator: SITE_TITLE_SEPARATOR, titleSeparator: SITE_TITLE_SEPARATOR,
i18nRouting: true, i18nRouting: true,

Loading…
Cancel
Save