website/docs: Fix labels, Pre-Release detection (#18945)

* Fix import path.

* Show unlisted entries if release.

* Fix sidebar rendering.

* Fix positioning of pre-release note. Tidy phrasing.

* Clarify pre-release vs draft.
This commit is contained in:
Teffen Ellis
2025-12-18 21:01:47 +01:00
committed by GitHub
parent de298d72de
commit 5babdf64cb
10 changed files with 97 additions and 74 deletions

View File

@@ -2,7 +2,7 @@
* @file Docusaurus Documentation config.
*
* @import { UserThemeConfig, UserThemeConfigExtra } from "@goauthentik/docusaurus-config";
* @import { AKReleasesPluginOptions } from "@goauthentik/docusaurus-theme/releases/plugin"
* @import { AKReleasesPluginOptions } from "@goauthentik/docusaurus-theme/releases/common"
* @import { AKRedirectsPluginOptions } from "@goauthentik/docusaurus-theme/redirects/plugin"
* @import { Options as RedirectsPluginOptions } from "@docusaurus/plugin-client-redirects";
*/

View File

@@ -1,15 +1,9 @@
---
title: Release 2025.12
slug: "/releases/2025.12"
unlisted: true
beta: true
---
:::info
2025.12 has not been released yet! We're publishing these release notes as a preview of what's to come, and for our awesome beta testers trying out release candidates.
To try out the release candidate, replace your Docker image tag with the latest release candidate number, such as xxxx.x.0-rc1. You can find the latest one in [the latest releases on GitHub](https://github.com/goauthentik/authentik/releases). If you don't find any, it means we haven't released one yet.
:::
## Highlights
- **Endpoint Devices**: :ak-enterprise Endpoint Devices is a new featureset for Windows, macOS, and Linux devices that enables SSH authentication, local device login, sudo authorization and more, all with authentik credentials.

View File

@@ -78,11 +78,11 @@ export const VersionDropdown = memo<VersionDropdownProps>((props) => {
let label = semVer;
const frontmatter = frontMatterRecord[semVer];
if (frontmatter?.unlisted || frontmatter?.draft) {
if (frontmatter?.draft) {
return null;
}
if (idx === 0) {
if (idx === 0 && !frontmatter?.beta) {
label += " (Current Release)";
}

View File

@@ -9,6 +9,7 @@
/**
* @typedef {object} AKReleaseFrontMatter
* @property {boolean} [beta] Whether the release is a beta.
* @property {boolean} [draft] Whether the release is a draft.
* @property {boolean} [unlisted] Whether the release is unlisted.
*/

View File

@@ -58,6 +58,10 @@ export function collectReleaseFiles(releasesParentDirectory) {
const { frontMatter } = parseFileContentFrontMatter(fileContent);
latestRelease.frontMatter = frontMatter;
if (latestRelease.frontMatter.beta) {
latestRelease.name += " (Release Candidate)";
}
}
return releaseFiles;
@@ -73,7 +77,14 @@ export function createReleaseSidebarEntries(releaseFiles) {
/**
* @type {SidebarItemConfig[]}
*/
let sidebarEntries = releaseFiles.map((fileEntry) => fileEntry.path);
let sidebarEntries = releaseFiles.map((fileEntry) => {
return {
type: "doc",
id: fileEntry.path,
label: fileEntry.name,
key: `release-${fileEntry.name}`,
};
});
if (releaseFiles.length > SUPPORTED_RELEASE_COUNT) {
// Then we add the rest of the releases as a category.

View File

@@ -1,60 +0,0 @@
import { useDoc } from "@docusaurus/plugin-content-docs/client";
import {
ThemeClassNames,
UnlistedBannerMessage,
UnlistedBannerTitle,
UnlistedMetadata,
} from "@docusaurus/theme-common";
import Translate from "@docusaurus/Translate";
import Admonition from "@theme/Admonition";
import type { Props } from "@theme/ContentVisibility/Unlisted";
import clsx from "clsx";
import React, { type ReactNode } from "react";
function UnlistedBanner({ className }: Props) {
const context = useDoc();
if (context.metadata.id?.startsWith("releases")) {
return (
<Admonition
type="note"
title={
<Translate
id="theme.contentVisibility.unlistedBanner.preRelease.title"
description="The unlisted content banner title"
>
Pre-Release Documentation
</Translate>
}
className={clsx(className, ThemeClassNames.common.unlistedBanner)}
>
<Translate
id="theme.contentVisibility.unlistedBanner.preRelease.message"
description="The unlisted content banner message"
>
This documentation is for an upcoming version of authentik. It may be incomplete
or subject to changes before the final release.
</Translate>
</Admonition>
);
}
return (
<Admonition
type="caution"
title={<UnlistedBannerTitle />}
className={clsx(className, ThemeClassNames.common.unlistedBanner)}
>
<UnlistedBannerMessage />
</Admonition>
);
}
export default function Unlisted(props: Props): ReactNode {
return (
<>
<UnlistedMetadata />
<UnlistedBanner {...props} />
</>
);
}

View File

@@ -0,0 +1,53 @@
import Link from "@docusaurus/Link";
import { ThemeClassNames } from "@docusaurus/theme-common";
import Translate from "@docusaurus/Translate";
import Admonition from "@theme/Admonition";
import ExternalLinkIcon from "@theme/Icon/ExternalLink";
import React from "react";
export const PreReleaseAdmonition: React.FC = () => {
return (
<Admonition
type="info"
title={null}
icon={null}
className={ThemeClassNames.common.unlistedBanner}
>
<p>
<Translate
id="theme.preReleaseAdmonition.message"
description="The beta content banner message"
values={{
releasesLink: (
<Link
to="https://github.com/goauthentik/authentik/releases"
target="_blank"
>
<Translate
id="theme.githubReleasesLinkLabelAdmonition"
description="The link label to the GitHub releases page"
>
GitHub releases
</Translate>
<ExternalLinkIcon />
</Link>
),
}}
>
{`Were publishing these release notes as a preview of what's to come. To try a release candidate, find the latest RC version on {releasesLink}, then update your Docker image tag accordingly.`}
</Translate>
</p>
<p>
<Link to="/install-config/beta/">
<Translate
id="theme.preReleaseAdmonition.betaTestingLinkLabel"
description="The link label to the beta testing documentation"
>
Read more about beta testing
</Translate>
</Link>
</p>
</Admonition>
);
};

View File

@@ -12,6 +12,7 @@ import { SupportBadge } from "#components/SupportBadge.tsx";
import { VersionBadge } from "#components/VersionBadge.tsx";
import { useSyntheticTitle } from "#hooks/title.ts";
import { PreReleaseAdmonition } from "#theme/DocItem/Content/PreReleaseAdmonition.tsx";
import { useDoc } from "@docusaurus/plugin-content-docs/client";
import { ThemeClassNames } from "@docusaurus/theme-common";
@@ -87,6 +88,8 @@ const DocItemContent: React.FC<Props> = ({ children }) => {
authentik_preview,
} = frontMatter;
const preReleaseDoc = frontMatter.beta && metadata.id.startsWith("releases");
useBadgeLinterEffect();
const badges: JSX.Element[] = [];
@@ -129,6 +132,8 @@ const DocItemContent: React.FC<Props> = ({ children }) => {
</header>
) : null}
{preReleaseDoc ? <PreReleaseAdmonition /> : null}
<MDXContent>{children}</MDXContent>
</div>
);

View File

@@ -1,20 +1,38 @@
/// <reference types="@docusaurus/plugin-content-docs" />
import "./styles.css";
import { isGlossaryItem } from "../utils/glossaryUtils";
import { VersionPicker } from "#components/VersionPicker/index.tsx";
import type { PropSidebarItem } from "@docusaurus/plugin-content-docs";
import {
DocSidebarItemsExpandedStateProvider,
useVisibleSidebarItems,
isVisibleSidebarItem,
} from "@docusaurus/plugin-content-docs/client";
import DocSidebarItem from "@theme/DocSidebarItem";
import type { Props as DocSidebarItemsProps } from "@theme/DocSidebarItems";
import { JSX, memo } from "react";
import { JSX, memo, useMemo } from "react";
function isReleaseNotesItem(item: PropSidebarItem): boolean {
return !!(item.type === "link" && item.docId?.startsWith("releases"));
}
function useVisibleSidebarItems(
items: readonly PropSidebarItem[],
activePath: string,
): PropSidebarItem[] {
return useMemo(
() =>
items.filter((item) => {
return isVisibleSidebarItem(item, activePath) || isReleaseNotesItem(item);
}),
[items, activePath],
);
}
const DocSidebarItems = ({ items, ...props }: DocSidebarItemsProps): JSX.Element => {
const visibleItems = useVisibleSidebarItems(items, props.activePath);
const includeVersionPicker = props.level === 1 && !props.activePath.startsWith("/integrations");
return (

View File

@@ -22,6 +22,7 @@ declare module "@docusaurus/plugin-content-docs/client" {
* @monkeypatch
*/
export interface DocFrontMatter extends BaseDocFrontMatter {
beta?: boolean;
support_level?: string;
authentik_version?: string;
authentik_preview: boolean;