Skip to content

Commit

Permalink
[Docs] Try 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Marten-Mrfc committed Feb 23, 2025
1 parent d5c0566 commit 01a43b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion documentation/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { themes } from 'prism-react-renderer';
import { Config } from '@docusaurus/types';
import { Options } from '@docusaurus/plugin-content-docs';
import { env } from "process";
import {
AUTHOR_FALLBACK,
AuthorData,
commitCache,
cacheAuthorData,
getFileCommitHashSafe,
} from "./src/utils/authorUtils";

import { preview, deploymentID } from "./src/utils/pageUtils";
cacheAuthorData(preview || env.NODE_ENV === "development");

const lightTheme = themes.vsLight;
Expand Down
9 changes: 9 additions & 0 deletions documentation/src/utils/pageUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { env } from "process";

export const preview = env.CI_ENV === "preview";

export const deploymentID: string =
`${env.GITHUB_PR_HEAD_OWNER}-${env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME}` // <PR head branch owner username>-<head branch name>
.substring(0, 28) // capped to 28 characters
.toLowerCase() // lowercase
.replaceAll(/[/_.]/g, "-"); // sanitize characters in branch names

0 comments on commit 01a43b2

Please # to comment.