Skip to content

Commit 7ad266f

Browse files
jaapiolinawolf
authored andcommitted
[FIX] use source file to render editlink
1 parent 9dc6c95 commit 7ad266f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/typo3-docs-theme/src/Twig/TwigExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ public function getEditOnGitHubLink(array $context): string
288288
return '';
289289
}
290290
$githubBranch = $this->themeSettings->getSettings('edit_on_github_branch', 'main');
291-
$currentFileName = $this->getCurrentFilename($context);
292-
if ($currentFileName === '') {
291+
$sourceFile = $this->getSourceFilename($context);
292+
if ($sourceFile === '') {
293293
return '';
294294
}
295295
$gitHubPerPageLink = $this->getEditOnGitHubLinkPerPage($renderContext);
296296

297297
$githubDirectory = trim($this->themeSettings->getSettings('edit_on_github_directory', 'Documentation'), '/');
298-
return $gitHubPerPageLink ?? sprintf("https://github.com/%s/edit/%s/%s/%s.rst", $githubButton, $githubBranch, $githubDirectory, $currentFileName);
298+
return $gitHubPerPageLink ?? sprintf("https://github.com/%s/edit/%s/%s/%s", $githubButton, $githubBranch, $githubDirectory, $sourceFile);
299299
}
300300

301301
private function getEditOnGitHubLinkPerPage(RenderContext $renderContext): string|null

0 commit comments

Comments
 (0)