ProjectEvergreen / greenwood

Greenwood is your workbench for the web, embracing web standards from the ground up to empower your stack from front to back.
https://www.greenwoodjs.io
MIT License
96 stars 9 forks source link

Feature/issue 1116 base path configuration #1135

Closed thescientist13 closed 9 months ago

thescientist13 commented 1 year ago

Related Issue

resolves #1116 (and #273)

Summary of Changes

  1. Add basePath support to greenwood.config.js (covers pages, API routes, and adapter routing, <script> and <link> tags, and GraphQL queries)
  2. Persist base path setting in a <script> tag
  3. Add Base Path configuration docs
  4. Update GitHub Pages guide to call out when to use a base path

TODO

  1. [x] Enable for greenwood build / greenwood serve
  2. [x] Support script and style tags
  3. [x] Check support for /graph.json Screenshot 2023-10-23 at 8 57 47 PM
  4. [x] Check support for static router Screenshot 2023-10-23 at 8 57 38 PM
  5. [x] Check support for 404 page
  6. [x] Odd margin: auto and navigation issues on the docs website Screenshot 2023-10-25 at 4 26 13 PM
  7. [x] Should this be baked into the graph / URLs by default?
  8. [x] Add test cases
    • develop
    • serve
    • graphql
    • static router
  9. [x] finish and add test cases for - https://github.com/ProjectEvergreen/greenwood/issues/273
  10. [x] Check support for dev proxy
  11. [x] Check support for API routes / SSR pages
  12. [x] Check support in adapters (for host routing)
  13. [x] Display basePath for server logging output
  14. [x] Add documentation
    • clarify this is only for greenwood routing (not for user content like links, forms, etc)
  15. [x] test with a project using GitHub pages and update GitHub pages guide - https://github.com/ProjectEvergreen/greenwood-demo-github-pages/issues/1
  16. [x] "lift" shared client side base path config to CLI output and document - https://github.com/thescientist13/greenwood-starter-presentation/pull/66
  17. [x] Remove demo code
  18. [x] Refactor tests to align with #1172

Questions

  1. [x] Is there actually a way to do it with just <base href="..."/> (make discussion) - https://github.com/ProjectEvergreen/greenwood/discussions/1175
  2. [x] should track an issue for customizing trailing forward slash - https://github.com/ProjectEvergreen/greenwood/issues/new