diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 04ba126..ed76bda 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -12,6 +12,11 @@ export default defineConfig({ // ignore all localhost links /^https?:\/\/localhost/, ], + head: [ + // Proxying Plausible through Netlify | Plausible docs + // https://plausible.io/docs/proxy/guides/netlify + ['script', { 'defer': 'true', 'data-domain': 'docs.neuri.dev', 'data-api': '/api/v1/page-external-data/submit', 'src': '/assets/page-external-data/js/script.js' }], + ], themeConfig: { outline: 'deep', socialLinks: [ diff --git a/docs/public/_redirects b/docs/public/_redirects new file mode 100644 index 0000000..a91a9b2 --- /dev/null +++ b/docs/public/_redirects @@ -0,0 +1,10 @@ +# Plausible.io analytics +# +# Proxying Plausible through Netlify | Plausible docs +# https://plausible.io/docs/proxy/guides/netlify +/assets/page-external-data/js/script.js https://plausible.io/js/script.js 200 +/api/v1/page-external-data/submit https://plausible.io/api/event 200 + +# i18n +/* /pages/en/:splat 301 +/* /pages/zh-CN/:splat 301 Language=zh-cn