TeamOfOne / guitarjs

Interactive creating, editing, playing and sharing guitar scores in the browser
https://teamofone.github.io/guitarjs/#/app/playlists/1/noname
Other
7 stars 2 forks source link

added static app hosting via docs folder #41

Closed fjsnogueira closed 8 years ago

fjsnogueira commented 8 years ago

copied smartGuitar/www to docs folder to be able to host statically the app in github pages, by pointing to the docs folder

waldyrious commented 8 years ago

Can you provide some details about what this does, in technical terms? I have quite a few questions:

  1. Is this a "compiled" version of the project all bundled into a folder?
  2. If I download this folder locally can I just open some index.html file in the browser and have the app run normally?
  3. If not, does it use some specific part of the github pages infrastructure to build the site?
  4. Does this mean we'll have to keep the files in this folder up to date with the rest of the repo?
  5. I think we can choose what folder (and even what branch) to host the site in. Wouldn't it make sense to place this in a separate branch, or a folder with a name other than "docs" (say, "web" or "build")?

Sorry for the wall of text 😅

fjsnogueira commented 8 years ago
  1. this is a copy of the source code of the project
  2. yes
  3. n/a
  4. yes (just copy smartGuitar/www to ./docs)
  5. after merging you can delete de branch as usual

this is a copy of smartGuitar/www to docs folder, witch is the source code of the app that doesn't need to bee compiled to run

waldyrious commented 8 years ago

Thanks for the clarifications, and I see that indeed the app runs as expected in https://teamofone.github.io/psc16-team33/docs/index.html

That said, I think you misunderstood my question 5. I meant that the folder for the static copy of the site should be called something other than "docs".

In fact, I just realized that if I open https://teamofone.github.io/psc16-team33/smartGuitar/www/ the app already works, so making a full copy of this folder is redundant, no?

fjsnogueira commented 8 years ago

@waldyrious yes it is redundant, and already works, but just because I named the branch gh-pages and you haven't merged the gh-pages with master branch and haven't deleted the branch, once you delete de branch you no longer be able to open the app from https://teamofone.github.io/psc16-team33/smartGuitar/www/ and the only one url will be https://teamofone.github.io/psc16-team33 after changing the repo settings to point to docs folder, this is mostly a matter of URL "frindeliness" .After pointing the gh pages to the docs folder the URL to the app will be shorter and simpler i.e. https://teamofone.github.io/psc16-team33 instead of https://teamofone.github.io/psc16-team33/smartGuitar/www/, and less redundant than maintaing to branches with the same code

fjsnogueira commented 8 years ago

@waldyrious just think about the workflow of adding a feature, if you keep the statically hosted app in a separed branch you will need to checkout that branch update it accordingly to the master branch and then make a commit, but if you instead just update de folder docs with the content of the www folder , you no longer need to switch and maintain two branches and keep it in sync. (this is a simplified workflow, the actual workflow implies another branch for the feature)

waldyrious commented 8 years ago

Good points, I agree with all of them. I was hoping that we could point the Github Pages to the smartGuitar/www folder directly, rather than making a copy of it, but according to https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/ they only support a folder specificaly named "docs" (which I find rather limiting, but I suppose they have their reasons). I wonder if we make a symlink from docs to smartGuitar/www it would work. That would allow us to avoid a duplication of the files. Shall we try?

waldyrious commented 8 years ago

I made a PR to test that hypothesis: #42