Skip to content

Conversation

@lancechentw
Copy link

Found that $this->outputPathResolver->link() would generate path without a leading slash for index files, e.g. index.blade.php, index.html, index.md, when using pretty urls (which is the default!)

This causes problem when we have source/blog/index.blade.php instead of source/blog.blade.php. link() would return blog for the former file, and return /blog for the latter file.

For example, GenerateSitemap.php from the blog template would generate the following if having source/blog/index.blade.php

   <url>
-   <loc>https://jigsaw-blog-template.tighten.co/blog</loc>
+   <loc>https://jigsaw-blog-template.tighten.coblog</loc>
    <lastmod>2025-11-27T07:21:16+00:00</lastmod>
    <changefreq>daily</changefreq>
   </url>

I have traced back to the commit 7aa603a#diff-76e91e6d5ebc8f831ce78c19c83441aa3b719af6a3d4098823f9195a639ec285R11 that introduced the change, and I think it was merely a bug, ltrim() should be applied right before $this->trimPath().

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.

1 participant