Skip to content

Conversation

@mateuszbartosik
Copy link
Contributor

Copy link
Contributor

@poissoncorp poissoncorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user flow is incorrect.
https://issues.hibernatingrhinos.com/issue/RDoc-3449/Plan-Edit-on-GitHub-button-for-community-fixes#focus=Comments-67-1071423.0-0

He's redirected to language-specific (currently selected) page content on GitHub (edit mode)

Instead of redirecting to GitHub article .mdx page (view mode) we need to generate links to according language-specific files in edit mode (based on the selected language context)

e.g. https://github.com/ravendb/docs/edit/main/docs/client-api/_setting-up-authentication-and-authorization-csharp.mdx instead of https://github.com/ravendb/docs/blob/main/docs/client-api/setting-up-authentication-and-authorization.mdx

So if I'm viewing Python version of a doc, I'm redirected to edit that specific Python version.
If the document is language-agnostic, fallback to the default article page.

@kalczur
Copy link
Contributor

kalczur commented Jan 9, 2026

@poissoncorp It should also point to the selected version, right?

@mateuszbartosik
Copy link
Contributor Author

e.g. https://github.com/ravendb/docs/edit/main/docs/client-api/_setting-up-authentication-and-authorization-csharp.mdx instead of https://github.com/ravendb/docs/blob/main/docs/client-api/setting-up-authentication-and-authorization.mdx

That might be hard to achieve because we have inconsistency in language-specific content placement. Some of the files are placed inside an additional content directory, while the others are located directly in the parent.

It could probably be possible using a customized editUrl functionality, but that's beyond my reach. @kalczur what do you think?

@Lwiel
Copy link
Contributor

Lwiel commented Jan 23, 2026

The user flow is incorrect. https://issues.hibernatingrhinos.com/issue/RDoc-3449/Plan-Edit-on-GitHub-button-for-community-fixes#focus=Comments-67-1071423.0-0

He's redirected to language-specific (currently selected) page content on GitHub (edit mode)

Instead of redirecting to GitHub article .mdx page (view mode) we need to generate links to according language-specific files in edit mode (based on the selected language context)

e.g. https://github.com/ravendb/docs/edit/main/docs/client-api/_setting-up-authentication-and-authorization-csharp.mdx instead of https://github.com/ravendb/docs/blob/main/docs/client-api/setting-up-authentication-and-authorization.mdx

So if I'm viewing Python version of a doc, I'm redirected to edit that specific Python version. If the document is language-agnostic, fallback to the default article page.

Added handling of this

@mateuszbartosik mateuszbartosik marked this pull request as ready for review January 26, 2026 10:54
@poissoncorp poissoncorp requested a review from kalczur January 26, 2026 10:55
title: "Connection String to Azure OpenAI"
sidebar_label: Azure OpenAI
sidebar_position: 1
supportedLanguages: ["csharp"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be snake_case for consistency?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed, used camel case at first because it's used as a property in the code but it's more important to have consistent frontmatter syntax

{canDisplayEditMetaRow && (
<EditMetaRow
className={clsx(ThemeClassNames.docs.docFooterEditMetaRow)}
editUrl={getEditUrlWithLanguage(editUrl, language, metadata.frontMatter.supportedLanguages)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extend DocFrontMatter type to get proper type for supportedLanguages.
You can put it in src/typescript/docMetadata.d.ts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extended

import { HIDDEN_EDIT_PAGE_ROUTES } from "@site/src/typescript/hiddenEditPageRoutes";
import {useLanguage} from "@site/src/components/LanguageStore";

const getEditUrlWithLanguage = (url: string, language: string, supportedLanguages: string[]) : string => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const getEditUrlWithLanguage = (url: string, language: string, supportedLanguages: string[]) : string => {
const getEditUrlWithLanguage = (url: string, language: DocsLanguage, supportedLanguages: DocsLanguage[]) : string => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@ppekrol ppekrol merged commit 11fcde5 into ravendb:main Jan 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants