Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const config: Config = {
}
},
onlyIncludeVersions: getOnlyIncludeVersions(),
//editUrl:
// 'https://github.com/ravendb/docs/tree/main/'
editUrl:
'https://github.com/ravendb/docs/tree/main/'
},
blog: false,
theme: {
Expand All @@ -81,6 +81,7 @@ const config: Config = {
path: 'cloud',
routeBasePath: 'cloud',
sidebarPath: './sidebarsCloud.js',
editUrl: 'https://github.com/ravendb/docs/tree/main'
},
]
],
Expand Down Expand Up @@ -184,7 +185,6 @@ const config: Config = {
},
{
items: [
{ label: "Contributing", href: "https://ravendb.net/" },
{ label: "About us", href: "https://ravendb.net/about" },
{ label: "Legal", href: "https://ravendb.net/legal" },
],
Expand Down
5 changes: 5 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,8 @@ hr {
.theme-doc-markdown header :is(h1, h2, h3, h4, h5, h6) {
@apply break-normal;
}

/* Smaller margin-top for pagination-nav */
.pagination-nav {
@apply !mt-8;
}
56 changes: 37 additions & 19 deletions src/theme/DocItem/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,47 @@ import React, { type ReactNode } from "react";
import clsx from "clsx";
import { ThemeClassNames } from "@docusaurus/theme-common";
import { useDoc } from "@docusaurus/plugin-content-docs/client";
import EditThisPage from "@site/src/theme/EditThisPage";
import TagsListInline from "@theme/TagsListInline";
import EditMetaRow from "@theme/EditMetaRow";
import { HIDDEN_EDIT_PAGE_ROUTES } from "@site/src/typescript/hiddenEditPageRoutes";

export default function DocItemFooter(): ReactNode {
const { metadata } = useDoc();
const { editUrl, lastUpdatedAt, lastUpdatedBy, tags } = metadata;
const { metadata } = useDoc();
const { editUrl, lastUpdatedAt, lastUpdatedBy, tags, permalink } = metadata;

const canDisplayTagsRow = tags.length > 0;
const canDisplayEditMetaRow = !!(editUrl || lastUpdatedAt || lastUpdatedBy);
const isPathHidden = HIDDEN_EDIT_PAGE_ROUTES.some((route) => {
return permalink.endsWith(route);
});

const canDisplayFooter = canDisplayTagsRow || canDisplayEditMetaRow;
const canDisplayTagsRow = tags.length > 0;
const canDisplayEditMetaRow = !!editUrl && !isPathHidden;

if (!canDisplayFooter) {
return null;
}
if (!canDisplayTagsRow && !canDisplayEditMetaRow) {
return null;
}

return (
<footer
className={clsx(
ThemeClassNames.docs.docFooter,
"docusaurus-mt-lg flex justify-end",
)}
>
<EditThisPage editUrl={editUrl} />
</footer>
);
return (
<footer className={clsx(ThemeClassNames.docs.docFooter, "mt-6")}>
{canDisplayTagsRow && (
<div
className={clsx(
"row",
ThemeClassNames.docs.docFooterTagsRow,
)}
>
<div className="col">
<TagsListInline tags={tags} />
</div>
</div>
)}
{canDisplayEditMetaRow && (
<EditMetaRow
className={clsx(ThemeClassNames.docs.docFooterEditMetaRow)}
editUrl={editUrl}
lastUpdatedAt={lastUpdatedAt}
lastUpdatedBy={lastUpdatedBy}
/>
)}
</footer>
);
}
19 changes: 13 additions & 6 deletions src/theme/EditThisPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import React, { type ReactNode } from "react";
import type { Props } from "@theme/EditThisPage";
import Button from "@site/src/components/Common/Button";
import { Icon } from "@site/src/components/Common/Icon";
import Link from "@docusaurus/Link";

export default function EditThisPage({ editUrl }: Props): ReactNode {
return (
<Button url={editUrl} variant="outline" size="sm">
🐱 Edit on GitHub
</Button>
);
return (
<div className="me-auto">
<Link
className="inline-flex items-center gap-2 text-sm leading-none"
to={editUrl}
>
<Icon icon="edit" size="xs" />
Edit on GitHub
</Link>
</div>
);
}
10 changes: 10 additions & 0 deletions src/typescript/hiddenEditPageRoutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const HIDDEN_EDIT_PAGE_ROUTES = [
"/ai-integration/ai-agents/start",
"/ai-integration/vector-search/start",
"/ai-integration/gen-ai-integration/start",
"/ai-integration/generating-embeddings/start",
"/ai-integration/start",
"/compare-exchange/start",
"/whats-new",
"/",
];
3 changes: 3 additions & 0 deletions static/icons/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion static/icons/studio-config.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.