Skip to content

Commit

Permalink
[BUGFIX] Use output file path for relative url calculations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
linawolf committed Dec 25, 2023
1 parent a729e66 commit 3198c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/guides/src/RenderContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getLink(string $name): string

public function getDirName(): string
{
$dirname = dirname($this->getCurrentFileName());
$dirname = dirname($this->outputFilePath);

if ($dirname === '.') {
return '';
Expand Down

0 comments on commit 3198c42

Please sign in to comment.