diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 43fff623..6c107e13 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -64,7 +64,6 @@ module.exports = { title: 'IPFS Blog & News', description: 'All the latest information about the IPFS Project in one place: blog posts, release notes, videos, news coverage, and more.', - domain: CANONICAL_BASE, locales: { '/': { lang: 'EN', @@ -96,6 +95,7 @@ module.exports = { }, }, themeConfig: { + domain: CANONICAL_BASE, locales: { '/': themeConfigDefaults, '/zh-cn/': { @@ -227,11 +227,11 @@ module.exports = { ['_blog'].some((folder) => $page.regularPath.startsWith('/' + folder)) ? 'article' : 'website', - url: (_, $site, path) => ($site.domain || '') + path, + url: (_, $site, path) => ($site.themeConfig.domain || '') + path, image: ($page, $site) => $page.frontmatter.header_image - ? ($site.domain || '') + $page.frontmatter.header_image - : ($site.domain || '') + '/social-card.png', + ? ($site.themeConfig.domain || '') + $page.frontmatter.header_image + : ($site.themeConfig.domain || '') + '/social-card.png', publishedAt: ($page) => $page.frontmatter.date && new Date($page.frontmatter.date).toISOString(), diff --git a/src/.vuepress/theme/layouts/GlobalLayout.vue b/src/.vuepress/theme/layouts/GlobalLayout.vue index 1e0b43f9..73ae7291 100644 --- a/src/.vuepress/theme/layouts/GlobalLayout.vue +++ b/src/.vuepress/theme/layouts/GlobalLayout.vue @@ -38,7 +38,9 @@ export default { }, beforeMount() { - countly.loadScript() + if (!this.$isServer && this.$themeConfig.domain) { + countly.loadScript() + } }, methods: { diff --git a/src/.vuepress/theme/util/countly.js b/src/.vuepress/theme/util/countly.js index 7edf936b..cffd1e0c 100644 --- a/src/.vuepress/theme/util/countly.js +++ b/src/.vuepress/theme/util/countly.js @@ -44,8 +44,6 @@ export function loadScript() { Track an event to countly with the provided data */ export function trackEvent(event, data = {}) { - // console.info('[countly]', 'trackEvent()', event, data) - window.Countly.q.push([ 'add_event', {