refactor: excude analytics based on CANONICAL_BASE config cc @jdiogopeixoto

This commit is contained in:
Chris Waring
2021-04-08 11:37:41 +01:00
parent f4ef5eaac8
commit 8a6d70b8a2
3 changed files with 7 additions and 7 deletions

View File

@@ -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(),

View File

@@ -38,7 +38,9 @@ export default {
},
beforeMount() {
countly.loadScript()
if (!this.$isServer && this.$themeConfig.domain) {
countly.loadScript()
}
},
methods: {

View File

@@ -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',
{