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 to configure my projects metadata #5

Closed
1 of 5 tasks
thescientist13 opened this issue Mar 26, 2019 · 6 comments · Fixed by #73
Closed
1 of 5 tasks

As a user I would like to configure my projects metadata #5

thescientist13 opened this issue Mar 26, 2019 · 6 comments · Fixed by #73
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 26, 2019

Type of Change

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

Summary

Basic site metadata will be needed in order to let application's configure the display of their site's information to crawlers and bots.

Details

  1. Will want to support the creation of a greenwood.config.js file with these options.
    {
      "title": "Greenwood Static Site Generator",
      "description": "A modern and performant static site generator supporting Web Components.",
      "url": "<project-website>"
      "type": "website"
    }
  2. These should be optional and not used if not provided
    {
      "image": "path/to/logo"
    }
  3. Should dynamically update index.html
  4. Nested pages should have a dynamically created url (nice to have, could be its own issue)
  5. Write tests
  6. Update README
@thescientist13 thescientist13 added the enhancement Improve something existing (e.g. no docs, new APIs, etc) label Mar 26, 2019
@thescientist13 thescientist13 added this to the MVP milestone Mar 26, 2019
@thescientist13 thescientist13 added this to TODO in 1 Mar 27, 2019
@hutchgrant
Copy link
Member

hutchgrant commented Apr 9, 2019

Can certainly accomplish 1-2, 5-6, but I'm not sure how we can do 3-4.

Maybe we can add those var in meta tags during serialization, in the jsdom, right after it renders?

@thescientist13
Copy link
Member Author

@hutchgrant
Yeah, I was thinking that we would just provide template "hooks" in the project's index.html, like

<title>{{title}}</title>

If a user wants to create their own index.html, they can, and we can provide a more robust solution to that via #17 where we can document / define what compilation information is available at build time, and at what point it can be accessed / injected.

@hutchgrant
Copy link
Member

hutchgrant commented Apr 10, 2019

The problem is we need it to be dynamic per page, and when our SPA is generated, there is only a single html file. Meaning, if we have many pages, each with different, dynamic, meta data, with only a single html being compiled, that won't suffice. However, when we're serializing, there is an opportunity to manage each page's index.html file with JSDOM before they're written to file.

Unless, we could build a component of some kind that can be rendered within each page-template(custom templates will have to add it as well), which could force updating the document head with route based meta tags. That's one way to get it to render the meta tags dynamically pre-serialization(something like helmet but a web component).

@thescientist13
Copy link
Member Author

Good point and yeah, figured there are a couple ways we might accomplish this given a particular use case.

For my primary inspiration on this, checkout helmet / gatsby-helmet. 🏈

@hutchgrant
Copy link
Member

Much of the meta data should be consolidated in config file and that file needs to be imported across multiple libs as per #11 IMO.

@thescientist13 thescientist13 self-assigned this Apr 16, 2019
@thescientist13 thescientist13 moved this from TODO to IN PROGRESS in 1 Apr 16, 2019
@thescientist13 thescientist13 moved this from IN PROGRESS to TODO in 1 Apr 16, 2019
@hutchgrant
Copy link
Member

hutchgrant commented Apr 20, 2019

I have built a simple helmet-like component that we can use within the wc-markdown-loader and page/app-template.

However there will be some issues to figure out. For example, some meta we will want to be site-wide and should be set from a site config file which will be used in app-template. Others, we may prefer to be set from specific page-templates. As well I want dynamic titles/descriptions so those have to be set within wc-markdown-loader via front-matter var(or extracted by parsing md titles/text). Plus, we want some of these(from any of these 3 methods) to be default.

@hutchgrant hutchgrant moved this from TODO to IN PROGRESS in 1 May 10, 2019
@hutchgrant hutchgrant moved this from IN PROGRESS to IN REVIEW in 1 May 10, 2019
@hutchgrant hutchgrant moved this from IN REVIEW to DONE in 1 May 15, 2019
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
Development

Successfully merging a pull request may close this issue.

2 participants