Skip to content

Commit 6720881

Browse files
author
Yassine El Haddad
authored
Merge pull request #240 from yel-hadd/master
Google search console verification
2 parents 55c3364 + 0d9029a commit 6720881

File tree

3 files changed

+75
-72
lines changed

3 files changed

+75
-72
lines changed

docs/.vuepress/headFunctions.ts

Lines changed: 75 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,81 @@
11
import routes from './routes.json';
22

33
export default [
4-
[
5-
"script",
6-
{
7-
type: "text/javascript",
8-
id: "hs-script-loader",
9-
async: true,
10-
defer: true,
11-
src: "//js.hs-scripts.com/5408110.js",
12-
},
13-
],
14-
[
15-
"script",
16-
{},
17-
`
18-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
19-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
20-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
21-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
22-
})(window,document,'script','dataLayer','GTM-T538N4K');
23-
`,
24-
],
25-
[
26-
"script",
27-
{},
28-
`
29-
(function() {
30-
var routes = ${JSON.stringify(routes)};
31-
32-
// Function to normalize a URL by removing a trailing slash and leading characters
33-
function normalizeUrl(url) {
34-
url = url.endsWith('/') ? url.slice(0, -1) : url;
35-
url = url.startsWith('/') ? url.slice(1) : url;
36-
url = url.startsWith('?') ? url.slice(1) : url;
37-
return url;
38-
}
4+
[
5+
"script",
6+
{
7+
type: "text/javascript",
8+
id: "hs-script-loader",
9+
async: true,
10+
defer: true,
11+
src: "//js.hs-scripts.com/5408110.js",
12+
},
13+
],
14+
[
15+
"script",
16+
{},
17+
`
18+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
19+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
20+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
21+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
22+
})(window,document,'script','dataLayer','GTM-T538N4K');
23+
`,
24+
],
25+
[
26+
"script",
27+
{},
28+
`
29+
(function() {
30+
var routes = ${JSON.stringify(routes)};
3931
40-
var currentPath = window.location.pathname + window.location.search + window.location.hash;
41-
currentPath = normalizeUrl(currentPath);
42-
43-
for (var route_url in routes) {
44-
if (normalizeUrl(route_url) === currentPath) {
45-
window.location.href = routes[route_url];
46-
break; // Exit the loop after redirecting
47-
}
48-
}
49-
})();
50-
`,
51-
],
52-
[
53-
"script",
54-
{},
55-
`
56-
(function() {
57-
// Trigger the scroll event without actually scrolling
58-
function triggerScrollEvent() {
59-
const targetElement = window;
60-
const scrollEvent = new Event('scroll', {
61-
bubbles: true,
62-
cancelable: true,
63-
});
64-
targetElement.dispatchEvent(scrollEvent);
65-
}
32+
// Function to normalize a URL by removing a trailing slash and leading characters
33+
function normalizeUrl(url) {
34+
url = url.endsWith('/') ? url.slice(0, -1) : url;
35+
url = url.startsWith('/') ? url.slice(1) : url;
36+
url = url.startsWith('?') ? url.slice(1) : url;
37+
return url;
38+
}
39+
40+
var currentPath = window.location.pathname + window.location.search + window.location.hash;
41+
currentPath = normalizeUrl(currentPath);
6642
67-
// Call the triggerScrollEvent and scrollBodyDown functions after the page is fully loaded
68-
window.addEventListener('load', () => {
69-
triggerScrollEvent();
70-
});
71-
})();
72-
`,
73-
]
74-
];
43+
for (var route_url in routes) {
44+
if (normalizeUrl(route_url) === currentPath) {
45+
window.location.href = routes[route_url];
46+
break; // Exit the loop after redirecting
47+
}
48+
}
49+
})();
50+
`,
51+
],
52+
[
53+
"script",
54+
{},
55+
`
56+
(function() {
57+
// Trigger the scroll event without actually scrolling
58+
function triggerScrollEvent() {
59+
const targetElement = window;
60+
const scrollEvent = new Event('scroll', {
61+
bubbles: true,
62+
cancelable: true,
63+
});
64+
targetElement.dispatchEvent(scrollEvent);
65+
}
7566
76-
67+
// Call the triggerScrollEvent and scrollBodyDown functions after the page is fully loaded
68+
window.addEventListener('load', () => {
69+
triggerScrollEvent();
70+
});
71+
})();
72+
`,
73+
],
74+
[
75+
"meta",
76+
{
77+
name: "google-site-verification",
78+
content: "5-Q2NFM8YQ1f64j819in5tsqnlwNjQXX6Y0PQzmBEcs",
79+
},
80+
],
81+
];

docs/.vuepress/public/googled5ceee86bf34d3e8.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/.vuepress/theme/layouts/Layout.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div class="theme-container">
3-
<meta name="google-site-verification" content="5-Q2NFM8YQ1f64j819in5tsqnlwNjQXX6Y0PQzmBEcs" />
43
<HeaderLayout :closeSidebarDrawer="pageRef?.closeSidebarDrawer" :isMobileWidth="isMobileWidth"/>
54
<Sidebar
65
v-if="allPages.length && !pageRef?.isOpenMobileSidebarMenu && !isMobileWidth"

0 commit comments

Comments
 (0)