docs: collect feedback form

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-08-06 15:29:23 +02:00
parent f45e74d134
commit ea14025e85
2 changed files with 55 additions and 4 deletions

View File

@ -30,6 +30,9 @@ module.exports = {
apiKey: "b2324f1ac8932ab80916382521473115", apiKey: "b2324f1ac8932ab80916382521473115",
indexName: "daggosaurus", indexName: "daggosaurus",
}, },
hotjar: {
siteId: "2541514",
},
colorMode: { colorMode: {
// "light" | "dark" // "light" | "dark"
defaultMode: "light", defaultMode: "light",
@ -40,7 +43,7 @@ module.exports = {
}, },
}, },
gtag: { gtag: {
trackingID: 'G-RDXG80F635', trackingID: "G-RDXG80F635",
anonymizeIP: true, anonymizeIP: true,
}, },
}, },
@ -63,10 +66,12 @@ module.exports = {
plugins: [ plugins: [
"docusaurus-plugin-sass", "docusaurus-plugin-sass",
[ [
"docusaurus2-dotenv", { "docusaurus2-dotenv",
{
systemvars: true, systemvars: true,
expand: true, expand: true,
}, },
] ],
path.resolve(__dirname, "plugins/docusaurus-plugin-hotjar"),
], ],
}; };

View File

@ -0,0 +1,46 @@
const path = require("path");
module.exports = function (context) {
const { siteConfig } = context;
const { themeConfig } = siteConfig;
const { hotjar } = themeConfig || {};
if (!hotjar) {
throw new Error(
`Create a 'hotjar' object containing a 'siteId' property in 'themeConfig'.`
);
}
const { siteId } = hotjar;
if (!siteId) {
throw new Error(
"Error in `themeConfig`. `hotjar` object found but `siteId` prop is missing."
);
}
return {
name: "docusaurus-plugin-hotjar",
injectHtmlTags() {
return {
headTags: [
{
tagName: "script",
innerHTML: `
<!-- Hotjar Tracking Code -->
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:${siteId},hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
`,
},
],
};
},
};
};