ember-learn / guidemaker-ember-template

Guidemaker template for Ember Guides websites
https://guidemaker-ember-template.netlify.app/release
MIT License
5 stars 22 forks source link

Add support for "main" branches in edit URLs #77

Closed jenweber closed 3 years ago

jenweber commented 3 years ago

Closes #76

@mansona is there a nicer way to pass this config variable? I would like to add this info to the CLI Guides.

cc @ijlee2

How to test:

  1. Run the app locally
  2. In app/templates/components/guides-article.hbs, copy the "edit page" link markup and paste it into the template outside of the if statement. See that it has "main" in the path
  3. Edit the dummy app config to remove the guidemaker-ember-template section
  4. Restart the app, and look at the url. It should say master in it.

master is the default, so this is a non-breaking minor change.

mansona commented 3 years ago

Ok so this has now been updated to use the "official" Guidemaker sourceBranch implementation. This is a tiny bit simpler now because we can do the fallback behaviour directly in the template so we don't need any of the JS changes 👍

How to test this: you need to edit tests/dummy/config/environment.js and add both a sourceRepo and a sourceBranch configuration to the guidemaker block. You will see the edit button appear and you can alter the branch that it targets by altering the sourceBranch 👍 More information on the config options are available here: https://github.com/empress/guidemaker#configuration

Note: just verify that the url is working, the actual link will probably not work for this repo because the guides folder isn't in the root of the repo 🙈 that is an issue that is specific to an addon and not something that we want to worry about at this stage 👍