diff --git a/pwa/gatsby-config.js b/pwa/gatsby-config.js index d85df6b..fa02b14 100644 --- a/pwa/gatsby-config.js +++ b/pwa/gatsby-config.js @@ -30,5 +30,34 @@ module.exports = { autoGenHomeLabel: "Home", }, }, + { + resolve: "gatsby-plugin-html-attributes", + options: { + lang: "nl-NL", + }, + }, + { + resolve: "gatsby-plugin-security-txt", + options: { + intro: `${ + process.env.GATSBY_SECURITY_TXT_INTRO ?? + "Information related to reporting security vulnerabilities of this site." + }`, + contact: `${ + process.env.GATSBY_SECURITY_TXT_CONTACT ?? "mailto:info@conduction.nl" + }`, + expires: `${ + process.env.GATSBY_SECURITY_TXT_EXPIRES ?? "2024-12-31T23:00:00.000Z" + }`, + encryption: `${process.env.GATSBY_SECURITY_TXT_ENCRYPTION ?? ""}`, + acknowledgements: `${ + process.env.GATSBY_SECURITY_TXT_ACKNOWLEDGEMENTS ?? "" + }`, + languages: `${process.env.GATSBY_SECURITY_TXT_LANGUAGES ?? "nl, en"}`, + canonical: `${process.env.GATSBY_SECURITY_TXT_CANONICAL ?? ""}`, + policy: `${process.env.GATSBY_SECURITY_TXT_POLICY ?? ""}`, + hiring: `${process.env.GATSBY_SECURITY_TXT_HIRING ?? ""}`, + }, + }, ], }; diff --git a/pwa/package-lock.json b/pwa/package-lock.json index 1f4e447..8c08c9f 100644 --- a/pwa/package-lock.json +++ b/pwa/package-lock.json @@ -53,7 +53,9 @@ "dedent": "^1.5.1", "gatsby": "^5.12.11", "gatsby-plugin-breadcrumb": "^12.3.2", + "gatsby-plugin-html-attributes": "^1.0.5", "gatsby-plugin-layout": "^4.12.0", + "gatsby-plugin-security-txt": "^1.2.1", "html-react-parser": "^5.0.6", "i18next": "^23.7.7", "jwt-decode": "^4.0.0", @@ -5458,6 +5460,27 @@ "core-js": "^3.0.0" } }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, "node_modules/balanced-match": { "version": "1.0.2", "license": "MIT" @@ -9067,6 +9090,14 @@ "gatsby": "3.x - 5.x" } }, + "node_modules/gatsby-plugin-html-attributes": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/gatsby-plugin-html-attributes/-/gatsby-plugin-html-attributes-1.0.5.tgz", + "integrity": "sha512-5u9AHfwxYuhl/QT+cI/r0+1oCKba/LPB6PHUaJN65swPOPrsAiNAj++hTSCs3CG3fITcR8Oorcn6hm6rN+uVAg==", + "dependencies": { + "babel-runtime": "^6.26.0" + } + }, "node_modules/gatsby-plugin-layout": { "version": "4.13.1", "resolved": "https://registry.npmjs.org/gatsby-plugin-layout/-/gatsby-plugin-layout-4.13.1.tgz", @@ -9106,6 +9137,17 @@ "gatsby": "^5.0.0-next" } }, + "node_modules/gatsby-plugin-security-txt": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/gatsby-plugin-security-txt/-/gatsby-plugin-security-txt-1.2.1.tgz", + "integrity": "sha512-AL2q2YQ4NtZsYp95C4mao74ETwBzSBlRB47PkDsK5BRieLovcM0E3kjSb7BJ6jGvX+5U3yKBspo/WJf1+Mad/A==", + "dependencies": { + "fs-extra": "^11.1.0" + }, + "peerDependencies": { + "gatsby": "^4.0.0 || ^5.0.0" + } + }, "node_modules/gatsby-plugin-typescript": { "version": "5.13.1", "resolved": "https://registry.npmjs.org/gatsby-plugin-typescript/-/gatsby-plugin-typescript-5.13.1.tgz", diff --git a/pwa/package.json b/pwa/package.json index 662c9c8..5c3c571 100644 --- a/pwa/package.json +++ b/pwa/package.json @@ -68,7 +68,9 @@ "dedent": "^1.5.1", "gatsby": "^5.12.11", "gatsby-plugin-breadcrumb": "^12.3.2", + "gatsby-plugin-html-attributes": "^1.0.5", "gatsby-plugin-layout": "^4.12.0", + "gatsby-plugin-security-txt": "^1.2.1", "html-react-parser": "^5.0.6", "i18next": "^23.7.7", "jwt-decode": "^4.0.0", diff --git a/pwa/src/apiService/resources/gitHub.ts b/pwa/src/apiService/resources/gitHub.ts index 40bf466..a022b4f 100644 --- a/pwa/src/apiService/resources/gitHub.ts +++ b/pwa/src/apiService/resources/gitHub.ts @@ -11,6 +11,10 @@ export default class GitHub { } public getContent = async (filePath: string): Promise => { + // For Development + // To test edited documentation paste name of the branch with the edited documentation + // filePath += `?ref=feature/example`; + const { data } = await this._send(this._instance, "GET", filePath); return data; diff --git a/pwa/src/hooks/htmlParser/anchor/getAnchor.tsx b/pwa/src/hooks/htmlParser/anchor/getAnchor.tsx index d8578b7..066ebbc 100644 --- a/pwa/src/hooks/htmlParser/anchor/getAnchor.tsx +++ b/pwa/src/hooks/htmlParser/anchor/getAnchor.tsx @@ -62,15 +62,6 @@ const handleInternalLinks = (props: any, targetFile: string, location: string, d return; // ensure no other flow is triggered } - // Internal Links: homepage - if (props.href.includes("/") && location === "/") { - const directoryFound = directories.some((directory) => directory.location === props.href); - - if (directoryFound) navigate(`/${targetFile}`); - - return; // ensure no other flow is triggered - } - // Internal Links: different directory if (props.href.includes("/")) { const targetDirectory = props.href.split("/").reverse()[1]; diff --git a/pwa/src/layout/Head.tsx b/pwa/src/layout/Head.tsx index 9cfc62e..0ad82d1 100644 --- a/pwa/src/layout/Head.tsx +++ b/pwa/src/layout/Head.tsx @@ -11,6 +11,9 @@ export const Head: React.FC = () => { return (