+ {hasMarkdownExport && (
+
+ )}
-
+
+
+ {hasMarkdownExport && (
+
+ )}
+
{docTOC.mobile}
{children}
diff --git a/src/theme/DocItem/Layout/styles.module.css b/src/theme/DocItem/Layout/styles.module.css
index 35940c2b7e..fef89e0096 100644
--- a/src/theme/DocItem/Layout/styles.module.css
+++ b/src/theme/DocItem/Layout/styles.module.css
@@ -3,6 +3,33 @@
margin-top: 0;
}
+/* Breadcrumbs on the left, the page's AI actions pinned to the right. On narrow
+ viewports the actions wrap onto their own line instead of being pushed out of
+ the viewport. */
+.docItemTopBar {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 12px 16px;
+ margin-bottom: var(--ifm-spacing-vertical);
+}
+
+/* Breadcrumbs bring their own bottom margin; the row now owns that spacing, so
+ drop it to avoid a doubled gap. `min-width: 0` lets a long trail shrink (it
+ scrolls on its own) rather than shoving the actions off-screen. */
+.docItemTopBar > nav {
+ margin-bottom: 0;
+ min-width: 0;
+}
+
+/* Keep the actions flush right even once they wrap onto their own line: the
+ dropdown is anchored to the trigger's right edge, so a left-aligned trigger
+ would send the panel off the left of the viewport. */
+.docItemTopBar > :last-child {
+ margin-left: auto;
+}
+
/* 1280px is where design-style.scss stops hiding the TOC column, so the two
have to agree. When they disagreed (1280 vs 1440), everything between those
two widths rendered the TOC alongside an article still claiming 100%, which
diff --git a/src/theme/MDXPage/index.tsx b/src/theme/MDXPage/index.tsx
index b3d12a0e44..f53655f15f 100644
--- a/src/theme/MDXPage/index.tsx
+++ b/src/theme/MDXPage/index.tsx
@@ -8,6 +8,7 @@ import MDXContent from "@theme/MDXContent";
import type { Props } from "@theme/MDXPage";
import TOC from "@theme/TOC";
import ContentVisibility from "@theme/ContentVisibility";
+import MarkdownAlternate from "@site/src/components/common/markdownTwin";
import clsx from "clsx";
import styles from "./styles.module.css";
@@ -25,6 +26,10 @@ export default function MDXPage(props: Props): JSX.Element {
const showTOC =
!hideTableOfContents && MDXPageContent.toc && MDXPageContent.toc.length > 0;
+ // `markdown-export` only twins `.md` pages -- an `.mdx` one would get a link
+ // to a file that was never written.
+ const hasMarkdownTwin = metadata.source?.endsWith(".md") ?? false;
+
return (
+ {hasMarkdownTwin && }