Skip to content

Commit e388a6f

Browse files
authored
Merge pull request #26 from wouterj/fix-assets-url
Do not include file location in the assets url
2 parents d3c600f + 243b602 commit e388a6f

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/KernelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static function (string $path) use ($parseSubPath): bool {
5353
}
5454

5555
$twig = $configuration->getTemplateEngine();
56-
$twig->addExtension(new AssetsExtension($buildContext->getOutputDir()));
56+
$twig->addExtension(new AssetsExtension());
5757

5858
return new DocsKernel(
5959
$configuration,

src/Twig/AssetsExtension.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414

1515
class AssetsExtension extends AbstractExtension
1616
{
17-
/** @var string */
18-
private $htmlOutputDir;
19-
20-
public function __construct(string $htmlOutputDir)
21-
{
22-
$this->htmlOutputDir = $htmlOutputDir;
23-
}
24-
2517
public function getFunctions(): array
2618
{
2719
return [
@@ -31,6 +23,6 @@ public function getFunctions(): array
3123

3224
public function asset($path)
3325
{
34-
return sprintf('%s/assets/%s', $this->htmlOutputDir, $path);
26+
return sprintf('assets/%s', $path);
3527
}
3628
}

0 commit comments

Comments
 (0)