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
fix(pagination): revamp pagination permalink management #631
Conversation
Hm, I should have test on my blog before opening the PR, I have a big issue. I'll update the tests to reflect the bug |
I don't understand something while serving with cobalt: whereas Why is that? Apart from this weirdness, the code is working |
This is a relative path, so where it leads depends on what page in your site you are starting from. I assume this link is being generated in |
yes! So it's the user's responsibility to add the leading slash again then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for going back over this!
} | ||
let mut attributes = document::permalink_attributes(&doc.front, &doc.file_path); | ||
let permalink = permalink::explode_permalink(&config.front_permalink, &attributes)?; | ||
let permalink_path = std::path::Path::new(&permalink); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how I feel about using std::path
for manipulating a URI path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another tool in the std lib to test for extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd either handlroll a solution (like we've done with other url stuff) or use Url::path_segments
to at least get the last segment and then check for the extension within that.
Correct. We should fix this in the docs. |
Looks good! Feel free to cleanup the commits and let me know when you've pushed them |
4046119
to
e041aad
Compare
@epage Done! |
fixes #622