diff --git a/docusaurus.config.ts b/docusaurus.config.ts index c8f6477978..4669bec97b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -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: { @@ -81,6 +81,7 @@ const config: Config = { path: 'cloud', routeBasePath: 'cloud', sidebarPath: './sidebarsCloud.js', + editUrl: 'https://github.com/ravendb/docs/tree/main' }, ] ], @@ -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" }, ], diff --git a/src/css/custom.css b/src/css/custom.css index 8e56499f9f..026b2fd8b1 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -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; +} \ No newline at end of file diff --git a/src/theme/DocItem/Footer/index.tsx b/src/theme/DocItem/Footer/index.tsx index 704b4f3487..c58c2096bb 100644 --- a/src/theme/DocItem/Footer/index.tsx +++ b/src/theme/DocItem/Footer/index.tsx @@ -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 ( - - ); + return ( + + ); } diff --git a/src/theme/EditThisPage/index.tsx b/src/theme/EditThisPage/index.tsx index b55c4e416b..d979c002a7 100644 --- a/src/theme/EditThisPage/index.tsx +++ b/src/theme/EditThisPage/index.tsx @@ -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 ( - - ); + return ( +
+ + + Edit on GitHub + +
+ ); } diff --git a/src/typescript/hiddenEditPageRoutes.ts b/src/typescript/hiddenEditPageRoutes.ts new file mode 100644 index 0000000000..62a6c766cf --- /dev/null +++ b/src/typescript/hiddenEditPageRoutes.ts @@ -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", + "/", +]; diff --git a/static/icons/edit.svg b/static/icons/edit.svg new file mode 100644 index 0000000000..a8eecbd1a8 --- /dev/null +++ b/static/icons/edit.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/icons/studio-config.svg b/static/icons/studio-config.svg index 0f144e0636..7772bf4de7 100644 --- a/static/icons/studio-config.svg +++ b/static/icons/studio-config.svg @@ -1,3 +1,3 @@ - +