Skip to content

Commit 3198c42

Browse files
committed
[BUGFIX] Use output file path for relative url calculations
In standard renderings output and input filenames with their paths are the same except for the file ending. However, in project based rendering nodes the currentFileName in the rendering context is null, leading to an error. In these cases we add the outputfile path manually to the render context. The relative urls must now be calculated relative to the output path, not the input path.
1 parent a729e66 commit 3198c42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/guides/src/RenderContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function getLink(string $name): string
134134

135135
public function getDirName(): string
136136
{
137-
$dirname = dirname($this->getCurrentFileName());
137+
$dirname = dirname($this->outputFilePath);
138138

139139
if ($dirname === '.') {
140140
return '';

0 commit comments

Comments
 (0)