Skip to content

Commit

Permalink
Merge pull request #125 from ConductionNL/feature/OP-186/Improvements
Browse files Browse the repository at this point in the history
Added improvements for development
  • Loading branch information
remko48 authored Feb 12, 2024
2 parents 0cf147b + 98db18c commit 3d1b473
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 19 deletions.
29 changes: 29 additions & 0 deletions pwa/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ""}`,
},
},
],
};
42 changes: 42 additions & 0 deletions pwa/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions pwa/src/apiService/resources/gitHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default class GitHub {
}

public getContent = async (filePath: string): Promise<any> => {
// 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;
Expand Down
9 changes: 0 additions & 9 deletions pwa/src/hooks/htmlParser/anchor/getAnchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 3 additions & 0 deletions pwa/src/layout/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export const Head: React.FC = () => {

return (
<Helmet
htmlAttributes={{
lang: "nl-NL",
}}
bodyAttributes={{
class: theme,
}}
Expand Down
11 changes: 11 additions & 0 deletions pwa/static/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ GATSBY_PAGE_TITLE="Common Gateway"

# NL-Design Theme
GATSBY_NL_DESIGN_THEME_CLASSNAME=conduction-theme

# Security.txt https://www.gatsbyjs.com/plugins/gatsby-plugin-security-txt/
GATSBY_SECURITY_TXT_INTRO=Information related to reporting security vulnerabilities of this site.
GATSBY_SECURITY_TXT_CONTACT=mailto:info@conduction.nl
GATSBY_SECURITY_TXT_EXPIRES=2024-12-31T23:00:00.000Z
GATSBY_SECURITY_TXT_ENCRYPTION=
GATSBY_SECURITY_TXT_ACKNOWLEDGEMENTS=
GATSBY_SECURITY_TXT_LANGUAGES=nl, en
GATSBY_SECURITY_TXT_CANONICAL=
GATSBY_SECURITY_TXT_POLICY=
GATSBY_SECURITY_TXT_HIRING=
12 changes: 12 additions & 0 deletions pwa/static/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ GATSBY_NAVBAR_CONTENT=

# Footer
GASTBY_FOOTER_CONTENT=
# options: "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5"
GATSBY_FOOTER_CONTENT_HEADER=
GATSBY_FOOTER_SHOW_LOGO=
GATSBY_FOOTER_LOGO_HREF=
Expand All @@ -32,3 +33,14 @@ GATSBY_PAGE_TITLE=

# NL-Design Theme
GATSBY_NL_DESIGN_THEME_CLASSNAME=

# Security.txt https://www.gatsbyjs.com/plugins/gatsby-plugin-security-txt/
GATSBY_SECURITY_TXT_INTRO=Information related to reporting security vulnerabilities of this site.
GATSBY_SECURITY_TXT_CONTACT=mailto:info@conduction.nl
GATSBY_SECURITY_TXT_EXPIRES=2024-12-31T23:00:00.000Z
GATSBY_SECURITY_TXT_ENCRYPTION=
GATSBY_SECURITY_TXT_ACKNOWLEDGEMENTS=
GATSBY_SECURITY_TXT_LANGUAGES=nl, en
GATSBY_SECURITY_TXT_CANONICAL=
GATSBY_SECURITY_TXT_POLICY=
GATSBY_SECURITY_TXT_HIRING=
10 changes: 0 additions & 10 deletions pwa/static/.well-known/security.txt

This file was deleted.

0 comments on commit 3d1b473

Please sign in to comment.