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

Update article excerpt component to use route helper method instead of legacy link formatter #1317

Conversation

caendesilva
Copy link
Member

Description

This PR fixes the issue where the blog post feed component was not working on nested pages due to incorrect link formatting. The issue was caused by the use of the legacy style of links in article-excerpt.blade.php. The fix changes the link format to use $post->getRoute, which dynamically resolves relative paths.

The change was made by replacing the following code:

- <a href="posts/{{ Hyde::formatLink($post->identifier . '.html') }}"> Read post</a>
+ <a href="{{ $post->getRoute() }}" > Read post</a>

This PR has been tested and verified to resolve the issue. This fixes #1316

@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #1317 (9199c3a) into master (aa75e9e) will not change coverage.
The diff coverage is n/a.

@@              Coverage Diff              @@
##              master     #1317     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
- Complexity      1328      2656   +1328     
=============================================
  Files            152       304    +152     
  Lines           3470      6940   +3470     
=============================================
+ Hits            3470      6940   +3470     

see 152 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva
Copy link
Member Author

I also ran a file check to ensure that we don't use the formatLink helper anywhere else in the Blade views. So this bug should be an isolated event.

caendesilva added a commit to caendesilva/hyde-large-example-site that referenced this pull request Mar 17, 2023
@caendesilva caendesilva marked this pull request as ready for review March 17, 2023 19:29
@caendesilva caendesilva merged commit 42d03b8 into master Mar 17, 2023
@caendesilva caendesilva deleted the update-article-excerpt-component-to-use-route-helper-method-instead-of-legacy-link-formatter branch March 17, 2023 19:37
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.

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