-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Work In Progress: hugolib: Extract date and slug from filename #4436
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
22c493f
hugolib: Extract date and slug from filename
bep 1d9e1e8
Work
bep f3db894
Work
bep 8d07454
Work
bep 69b829e
Work
bep 51574fd
Work
bep 3d6d4eb
Working
bep 2b61ea7
Rename
bep 69b97b2
Adjust pubdate
bep 247a82f
Test work
bep 0bb9de7
More
bep 352e787
More
bep dbd5c97
Move to pagemeta package
bep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 fixed this in PR #4340. Please see my comment on why you really should just merge it.
I'm not sure what you mean by "more unit style". I don't think you mean tests of smaller "units" such as an individual functions. What I did with these tests is to cover "the complex" that governs date values (front matter, filenames, file timestamps)... the "unit" is the blackbox the is Hugo's content processing. Or perhaps the table of inputs and outputs don't seem unit style to you? But that table is the data for data-driven unit tests. Inputs and outputs stripped of all the scaffolding code.
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.
A creating a site, then do a full build, and check the result will by most people categorised as an integration test. We do that a lot in Hugo, because building all is often cheaper/easier than creating testable and smaller units. My new
frontmatterHandler
has no dependencies toPage
orSite
and can be tested as an unit.