You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the rationale for this request?
Allow authors to specify an array of globs for the globs option, which can help reduce repeated configuration
What changes did you make? (Give an overview)
Simple one line code change to allow said feature
Small rewrite of the complex reduce - concat method of collecting pages with globs and walkSync using flatMap instead.
Some other minor refactors to collectAddressablePages
Update documentation accordingly
Update existing site.json for test sites / docs and update test files accordingly.
Two of the test sites' expected siteData.json's page entries order was swapped due to walkSync now collecting the pages from all globs in the array simultaneously. ( the properties remain the same though )
Provide some example code that this change will affect:
Is there anything you'd like reviewers to focus on?
Should we allow this for src as well?
Testing instructions:
npm run test should pass ( existing site.json for docs and test sites were updated to use new syntax )
Proposed commit message: (wrap lines at 72 characters)
Allow an array for specifying page src or glob
The site configuration does not allow using an array for specifying
pages in the src or glob property.
The method for collecting the addressable pages can also be
made slightly simpler in the process.
Let’s do so, reducing the amount of repeated configuration the
author potentially needs to write.
Let’s also simplify the method for collecting addressable pages
in the process.
The functional changes are summarised by this line globs: Array.isArray(page.glob) ? page.glob : [page.glob],,
while the rest of the changes are just to refactor collectAddressablePages using lodash's flatMap.
Yes, I think this would be good. It would solve the same issue of repeated configuration. Unless there was a reason for making it a per-file configuration?
Maybe we can get the opinions of @damithc@marvinchin?
The site configuration does not allow using an array for specifying
pages in the src or glob property.
The method for collecting the addressable pages can also be
made slightly simpler in the process.
Let’s do so, reducing the amount of repeated configuration the
author potentially needs to write.
Let’s also simplify the method for collecting addressable pages
in the process.
The site configuration does not allow using an array for specifying
pages in the src or glob property.
The method for collecting the addressable pages can also be
made slightly simpler in the process.
Let’s do so, reducing the amount of repeated configuration the
author potentially needs to write.
Let’s also simplify the method for collecting addressable pages
in the process.
This file contains hidden or 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
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.
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Documentation update
• [x] Enhancement to an existing feature
Resolves#789
What is the rationale for this request?
Allow authors to specify an array of globs for the
globsoption, which can help reduce repeated configurationWhat changes did you make? (Give an overview)
reduce - concatmethod of collecting pages with globs andwalkSyncusingflatMapinstead.collectAddressablePagessite.jsonfor test sites / docs and update test files accordingly.siteData.json's page entries order was swapped due towalkSyncnow collecting the pages from all globs in the array simultaneously. ( the properties remain the same though )Provide some example code that this change will affect:
Is there anything you'd like reviewers to focus on?
Should we allow this forsrcas well?Testing instructions:
npm run testshould pass ( existingsite.jsonfor docs and test sites were updated to use new syntax )Proposed commit message: (wrap lines at 72 characters)
Allow an array for specifying page src or glob
The site configuration does not allow using an array for specifying
pages in the src or glob property.
The method for collecting the addressable pages can also be
made slightly simpler in the process.
Let’s do so, reducing the amount of repeated configuration the
author potentially needs to write.
Let’s also simplify the method for collecting addressable pages
in the process.