-
Notifications
You must be signed in to change notification settings - Fork 2
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
Simplify pages' configuration format #9
Conversation
this seems significantly less noisy and generally easier to scan the implementation could likely be improved WRT elegance and efficiency
fa4ba24
to
4cd957a
Compare
while syntactically this might look more complicated, it's actually more explicit and thus easier to understand (less context required)
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.
Apart from that: I like it. Thank you!
@@ -3,7 +3,7 @@ let path = require("path"); | |||
|
|||
module.exports = { | |||
styleguide: [{ | |||
source: "./pages.json", | |||
source: "./pages.js", |
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.
Different idea:
source: require("./pages")
This way, we can reserve the String for the Roman-style configuration where you just provide a path and we will detect all md Files for you and deduce the page structure from there. So the contract is:
- Either provide a path, then we will do it Roman-style
- Or provide a data structure, then we will do it FND-style
With the second option, you can either a) put it in the faucet.config.js directly b) put it in a JS file and require it or c) put it in a JSON file and require it
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 like it!
Hover, I'm currently deep in the weeds preparing the next PR, which directly affects this processing:
https://github.com/FND/styleguide/blob/decf0a6a22bf5cbaa8eee033121893485ee83121/lib/site.js#L56
Would you mind putting off this change until that part's stable? It seems easier to adjust (more neatly encapsulated) over there and would save me the trouble of rebasing with conflicts.
Reboot of this in #13 |
please review commits individually
a few semi-related observations:
faucet.config.js
) - perhaps something about resources or routes?faucet.config.js
, which strikes me as odd/inconsistent