From 53baa806d9af54a721ac11874e197ec908abcc14 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 17 Nov 2022 11:12:36 +0100 Subject: [PATCH] website: add greenhouse Signed-off-by: Jens Langhammer --- website/docusaurus.config.js | 6 +++--- website/src/pages/jobs.jsx | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 website/src/pages/jobs.jsx diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 045d697b3..4f52a11dd 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -41,9 +41,9 @@ module.exports = { position: "left", }, { - to: "api/", - activeBasePath: "api", - label: "API", + to: "jobs/", + activeBasePath: "jobs", + label: "Jobs", position: "left", }, { diff --git a/website/src/pages/jobs.jsx b/website/src/pages/jobs.jsx new file mode 100644 index 000000000..b8bc84489 --- /dev/null +++ b/website/src/pages/jobs.jsx @@ -0,0 +1,41 @@ +import React from "react"; +import Layout from "@theme/Layout"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import { useEffect } from "react"; +import { useColorMode } from "@docusaurus/theme-common"; + +const useScript = (url, selector = "body", async = true) => { + useEffect(() => { + const element = document.querySelector(selector); + const script = document.createElement("script"); + script.src = url; + script.async = async; + element.appendChild(script); + return () => { + element.removeChild(script); + }; + }, [url]); +}; + +function JobBoardWrapper() { + const context = useDocusaurusContext(); + const { siteConfig = {} } = context; + return ( + + + + ); +} + +function JobBoard() { + useScript( + "https://boards.greenhouse.io/embed/job_board/js?for=authentiksecurity" + ); + const { colorMode, setColorMode } = useColorMode(); + if (colorMode !== "light") { + setColorMode("light"); + } + return
; +} + +export default JobBoardWrapper;