Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: The blog post feed component does not work on nested pages due to not using routes #1316

Closed
caendesilva opened this issue Mar 17, 2023 · 0 comments · Fixed by #1317
Closed
Assignees
Labels
bug Something isn't working

Comments

@caendesilva
Copy link
Member

caendesilva commented Mar 17, 2023

Steps to reproduce:

  1. Run the following commands:
php hyde publish:homepage posts -n
mkdir _pages/posts
mv _pages/index.blade.php _pages/posts/index.blade.php
touch _posts/foo.md
php hyde build
  1. Visit _site/posts/index.html
  2. Click on the link for the post
  3. It leads to _site/posts/posts/foo.html instead of _site/posts/foo.html

Expected behavior:

Clicking on the link for the post should lead to _site/posts/foo.html.

Actual behavior:

Clicking on the link for the post leads to _site/posts/posts/foo.html.

Cause of the issue:

The issue is caused by article-excerpt.blade.php where the link uses the legacy style of links: href="posts/{{ Hyde::formatLink($post->identifier . '.html') }}" instead of $post->getRoute, which dynamically resolves relative paths.

Possible solution:

Use $post->getRoute instead of Hyde::formatLink in article-excerpt.blade.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant