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

index.md is needed when creating nested directories (aka should greenwood have template defaults?) #120

Closed
1 of 5 tasks
thescientist13 opened this issue Jul 10, 2019 · 5 comments
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Related to this test case
https://github.com/ProjectEvergreen/greenwood/blob/master/test/cli/cases/build.default.workspace-nested/build.default.workspace-nested.spec.js#L27

I guess the question / bug is: should Greenwood generate a default index.html for the user?

I think the answer would be yes, but I suppose, if the user is making nested directories, wouldn't at that point having a home page make sense?

Details

For reference, here is the error when deleting that file and running yarn test

  Build Greenwood With:
    Default Greenwood Configuration and Default Workspace w/ Nested Directories
      1) "before all" hook for "should create a default blog page directory"


  0 passing (6s)
  1 failing

  1) Build Greenwood With:
       Default Greenwood Configuration and Default Workspace w/ Nested Directories
         "before all" hook for "should create a default blog page directory":
     Error: the string "\u001b[31m./.greenwood/app/app.js\nModule not found: Error: Can't resolve '../index/index.js' in '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/test/cli/cases/build.default.workspace-nested/.greenwood/app'\u001b[39m\n" was thrown, throw an Error :)

I think this is the part that is tripping things up; the hardcoded in Greenwood's app-template

import '../index/index.js';

Again, not sure if Greenwood should be doing this for the user, but I think that's been our general convention.

@thescientist13 thescientist13 added bug Something isn't working question Further information is requested labels Jul 10, 2019
@thescientist13 thescientist13 changed the title index.md is needed when creating nested directories index.{md is needed when creating nested directories Jul 10, 2019
@thescientist13 thescientist13 changed the title index.{md is needed when creating nested directories index.md is needed when creating nested directories Jul 10, 2019
@thescientist13
Copy link
Member Author

thescientist13 commented Aug 4, 2019

this kind of brings up a more interesting debate i've been revisiting; whether or not Greenwood should include default pages and templates (aside from the app shell; index.html and app-template.js). Essentially it is the debate of explicit vs implicit.

Currently that pages and templates are provided by default is essentially an implicit support. Some might argue that it is better to be explicit in that if pages/ and page-template.js are missing, Greenwood should make that clear in the error message. The message could easily link to the API or Getting Started docs on the website.

I think it comes down to this: is it really that likely that someone will install Greenwood to not create their own content? Why even support all that code and logic if not needed. We have all the test cases anyway so adapting and filling in the gaps should be super easy.

@thescientist13 thescientist13 added this to the MVP milestone Aug 4, 2019
@thescientist13 thescientist13 changed the title index.md is needed when creating nested directories index.md is needed when creating nested directories (aka should greenwood have template defaults?) Aug 15, 2019
@thescientist13
Copy link
Member Author

thescientist13 commented Oct 30, 2019

Interesting question, if using an external data source (#21 ), could we do away with the need to having any local markdown? 🤔

@thescientist13
Copy link
Member Author

Or we should just add something about this to the documentation and make sure it is explicit for users.

@thescientist13 thescientist13 self-assigned this Nov 7, 2020
@thescientist13
Copy link
Member Author

I think this is taken care of as part of #355

@thescientist13
Copy link
Member Author

no longer an issue, solved as part of v0.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant