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

As a user I would like default page template values based on filepath #30

Closed
1 of 5 tasks
thescientist13 opened this issue Mar 31, 2019 · 2 comments · Fixed by #52 or #58
Closed
1 of 5 tasks

As a user I would like default page template values based on filepath #30

thescientist13 opened this issue Mar 31, 2019 · 2 comments · Fixed by #52 or #58
Assignees
Labels
enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.2.0
Projects
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Mar 31, 2019

Type of Change

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

Summary

Front matter for a give page may look something like

---
path: '/hello'
label: 'hello'
template: 'page'
---

### Hello World

This is an example page built by Greenwood.  Make your own in _src/pages_!

I think we could easily infer from defaults from the file name / path

  • Label
  • Path
  • Template (page is default)

Details

Allow Greenwood to provide defaults for the following, given a file path of
src/pages/blog/2019-03-31/index.md

  • Label: index
  • Path: /blog/2019-03-31/
  • Template: 'page'
@hutchgrant
Copy link
Member

hutchgrant commented Apr 8, 2019

label is still required because we use it for the web component element name e.g. <wc-md-helloworld></wc-md-helloworld> .

Although, we could use the file's name plus randomly generated string e.g. <wc-md-helloworld-dgfhj23re></wc-md-helloworld-dgfhj23re> However, if we do that, it would be impossible to guess the element name of a component pre-build. There's a chance someone wants to re-use a generated component(don't have an example, but it's possible?). Perhaps that should be an exception not the rule.

The path var can be removed and is fixed in #35. If no template, we could assume default page-template yes. Also fixed in #35.

edit: this problem of using labels isn't that simple. wc-md-loader requires a label to export the markdown to a generated component. IF we had wc-md-loader randomize the label, we wouldn't be able to retrieve the generated variable for our writePageComponentsFromTemplate function.

We can certainly use everything in this project with a generated label name, but the wc-md-loader will not bundle properly without it :(

@hutchgrant hutchgrant added this to IN REVIEW in 1 Apr 9, 2019
@thescientist13 thescientist13 moved this from IN REVIEW to IN PROGRESS in 1 Apr 10, 2019
@thescientist13 thescientist13 moved this from IN PROGRESS to TODO in 1 Apr 14, 2019
@hutchgrant hutchgrant moved this from TODO to IN PROGRESS in 1 Apr 17, 2019
@hutchgrant hutchgrant moved this from IN PROGRESS to IN REVIEW in 1 Apr 22, 2019
@thescientist13
Copy link
Member Author

Actually, this one seems a little ambition for a Sprint 1, maybe it should get put aside for a later sprint I think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.2.0
Projects
No open projects
1
DONE
2 participants