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

sub _build_posts does not sort a file list with both .md and .markdown correctly #50

Open
taskboy3000 opened this issue Jun 20, 2020 · 1 comment
Labels

Comments

@taskboy3000
Copy link
Collaborator

taskboy3000 commented Jun 20, 2020

This may be irrelevant, considering the list is later sorted by desired publication date, but in the posts builder, this line appears:

            sort { $a->basename cmp $b->basename }

In context, $a and $b are Path::Class::File objects and one might expect basename to return the filename without an extension here. However, it does not. The extension is still present.

Using the venerable File::Basename::basename routine allows the caller to provide a list extensions to be stripped out of the returned file name. However, Path::Class::File::basename does not appear to take extensions as arguments to strip off, which is surprising.

Ultimately, the list of posts is sorted by the desired publication date, which Plerd::Post calculates.

Frankly, I would suggest removing the file sort as it appears do work that is ultimately thrown away.

Marking this as an enhancement because it does not really cause problems in the project. This is sort of "it would be nice to fix for pendantry" issue.

@jmacdotorg
Copy link
Owner

Re-labeling as a bug, since if it's doing work that gets tossed, it might be unnecessarily slowing down publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants