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

Simplify pages' configuration format #9

Closed
wants to merge 3 commits into from

Conversation

FND
Copy link
Collaborator

@FND FND commented Nov 7, 2018

this seems significantly less noisy and generally easier to scan

the implementation could likely be improved WRT elegance and efficiency

please review commits individually

a few semi-related observations:

  • "pages' configuration format" is an awkward and not particularly suitable term; seems like we need some unambiguous description for that file (particularly WRT distinguishing this config from faucet.config.js) - perhaps something about resources or routes?
  • some metadata (namely title and description) still resides in faucet.config.js, which strikes me as odd/inconsistent

this seems significantly less noisy and generally easier to scan

the implementation could likely be improved WRT elegance and efficiency
@FND FND force-pushed the simple-config branch 2 times, most recently from fa4ba24 to 4cd957a Compare November 8, 2018 07:14
while syntactically this might look more complicated, it's actually more
explicit and thus easier to understand (less context required)
Copy link
Member

@moonglum moonglum left a 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",
Copy link
Member

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

Copy link
Collaborator Author

@FND FND Nov 9, 2018

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.

@moonglum
Copy link
Member

Reboot of this in #13

@moonglum moonglum closed this Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants