website/docs: Update deps. (#14397)

* website/docs: Update deps.

* website/docs: Port partial monorepo fixes. Fix build warnings.

* website/docs: Update Prettier.

* website/docs: Format. Update deps.

* website/docs: Remove empty entry.
This commit is contained in:
Teffen Ellis
2025-05-05 18:59:49 +02:00
committed by GitHub
parent d048f1ecbd
commit 264f59775c
25 changed files with 2224 additions and 1106 deletions

View File

@ -1,8 +1,5 @@
import { SupportLevelToLabel, isSupportLevel } from "@site/remark/support-directive";
import React from "react";
import {
isSupportLevel,
SupportLevelToLabel,
} from "@site/remark/support-directive";
export interface SupportBadgeProps {
level: string;

View File

@ -18,9 +18,7 @@ export const VersionBadge: React.FC<AuthentikVersionProps> = ({ semver }) => {
const yearCutoff = new Date().getFullYear() - 2;
if (parsed.major <= yearCutoff) {
throw new Error(
`Semver version <= ${yearCutoff} is not supported: ${semver}`,
);
throw new Error(`Semver version <= ${yearCutoff} is not supported: ${semver}`);
}
return (

View File

@ -14,8 +14,7 @@ import { useDoc } from "@docusaurus/plugin-content-docs/client";
*/
export function useSyntheticTitle(): string | null {
const { metadata, frontMatter, contentTitle } = useDoc();
const shouldRender =
!frontMatter.hide_title && typeof contentTitle === "undefined";
const shouldRender = !frontMatter.hide_title && typeof contentTitle === "undefined";
if (!shouldRender) {
return null;
}

View File

@ -1,5 +1,5 @@
import React from "react";
import { Redirect } from "@docusaurus/router";
import React from "react";
function Home() {
return <Redirect to="/docs" />;

View File

@ -7,21 +7,17 @@
* the content of a documentation page. However, it also adds support for
* support badges, and Authentik version badges.
*/
import React from "react";
import clsx from "clsx";
import { ThemeClassNames } from "@docusaurus/theme-common";
import {
DocContextValue,
useDoc,
} from "@docusaurus/plugin-content-docs/client";
import Heading from "@theme/Heading";
import MDXContent from "@theme/MDXContent";
import type { Props } from "@theme/DocItem/Content";
import { DocFrontMatter } from "@docusaurus/plugin-content-docs";
import { useSyntheticTitle } from "@site/src/hooks/title";
import { DocContextValue, useDoc } from "@docusaurus/plugin-content-docs/client";
import { ThemeClassNames } from "@docusaurus/theme-common";
import { SupportBadge } from "@site/src/components/SupportBadge";
import { VersionBadge } from "@site/src/components/VersionBadge";
import { useSyntheticTitle } from "@site/src/hooks/title";
import type { Props } from "@theme/DocItem/Content";
import Heading from "@theme/Heading";
import MDXContent from "@theme/MDXContent";
import clsx from "clsx";
import React from "react";
interface SwizzledDocFrontMatter extends DocFrontMatter {
support_level?: string;
@ -37,12 +33,8 @@ interface SwizzledDocContextValue extends DocContextValue {
const DocItemContent: React.FC<Props> = ({ children }) => {
const syntheticTitle = useSyntheticTitle();
const { frontMatter } = useDoc() as SwizzledDocContextValue;
const {
support_level,
authentik_version,
authentik_enterprise,
authentik_preview,
} = frontMatter;
const { support_level, authentik_version, authentik_enterprise, authentik_preview } =
frontMatter;
const badges: JSX.Element[] = [];
@ -71,9 +63,7 @@ const DocItemContent: React.FC<Props> = ({ children }) => {
{badges.length ? (
<p className="badge-group">
{badges.map((badge, index) => (
<React.Fragment key={index}>
{badge}
</React.Fragment>
<React.Fragment key={index}>{badge}</React.Fragment>
))}
</p>
) : null}

View File

@ -1,13 +1,13 @@
import React, { type ReactNode } from "react";
import clsx from "clsx";
import EditThisPage from "@theme/EditThisPage";
import type { Props } from "@theme/EditMetaRow";
import LastUpdated from "@theme/LastUpdated";
import Admonition from "@theme/Admonition";
import styles from "./styles.module.css";
import Translate from "@docusaurus/Translate";
import Admonition from "@theme/Admonition";
import IconNote from "@theme/Admonition/Icon/Note";
import type { Props } from "@theme/EditMetaRow";
import EditThisPage from "@theme/EditThisPage";
import LastUpdated from "@theme/LastUpdated";
import clsx from "clsx";
import React, { type ReactNode } from "react";
import styles from "./styles.module.css";
const EditMetaRow: React.FC<Props> = ({
className,
@ -40,11 +40,9 @@ const EditMetaRow: React.FC<Props> = ({
id="theme.common.contributor.footerDescription1"
description="The description for the contribution footer"
>
We welcome your knowledge and expertise. If you see
areas of the documentation that you can improve (fix a
typo, correct a technical detail, add additional
context, etc.) we would really appreciate your
contribution.
We welcome your knowledge and expertise. If you see areas of the
documentation that you can improve (fix a typo, correct a technical detail,
add additional context, etc.) we would really appreciate your contribution.
</Translate>
</p>
@ -109,10 +107,7 @@ const EditMetaRow: React.FC<Props> = ({
<div className="row">
<div className={clsx("col", styles.lastUpdated)}>
{(lastUpdatedAt || lastUpdatedBy) && (
<LastUpdated
lastUpdatedAt={lastUpdatedAt}
lastUpdatedBy={lastUpdatedBy}
/>
<LastUpdated lastUpdatedAt={lastUpdatedAt} lastUpdatedBy={lastUpdatedBy} />
)}
</div>
</div>

View File

@ -52,8 +52,7 @@ html[data-theme="dark"] {
display: flex;
gap: var(--ifm-spacing-horizontal);
justify-content: center;
margin: calc(var(--ifm-spacing-horizontal) * 2) 0
var(--ifm-spacing-horizontal);
margin: calc(var(--ifm-spacing-horizontal) * 2) 0 var(--ifm-spacing-horizontal);
padding: 0;
}

View File

@ -1,8 +1,8 @@
import React, { type ReactNode } from "react";
import Link from "@docusaurus/Link";
import Translate from "@docusaurus/Translate";
import { ThemeClassNames } from "@docusaurus/theme-common";
import Link from "@docusaurus/Link";
import type { Props } from "@theme/EditThisPage";
import React, { type ReactNode } from "react";
export default function EditThisPage({ editUrl }: Props): ReactNode {
return (

View File

@ -1,7 +1,5 @@
export function generateVersionDropdown(allReleases) {
const releases = allReleases.filter(
(release) => typeof release === "string",
);
const releases = allReleases.filter((release) => typeof release === "string");
const latest = releases[0].replace(/releases\/\d+\/v/, "");
return `<div class="navbar__item dropdown dropdown--hoverable dropdown--right">
<div aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link menu__link">