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

Create static demo page for github-pages #67

Open
hackingbeauty opened this issue Feb 27, 2016 · 13 comments
Open

Create static demo page for github-pages #67

hackingbeauty opened this issue Feb 27, 2016 · 13 comments
Labels

Comments

@hackingbeauty
Copy link

After developing my component, I'd like to create a demo page and push to github-pages.

Can we create a command for this? Or does this use-case already exist?

@insin
Copy link
Owner

insin commented Feb 27, 2016

Is there a common workflow for that? Happy to add a per-repo command to make it easier.

@dtinth
Copy link
Contributor

dtinth commented Mar 16, 2016

This is what I did for redux-send.

npm install --save-dev gulp gulp-gh-pages

No gulpfile involved! Just a one liner shell script:

  "scripts": {
    "gh-pages": "node -e \"require('gulp').src('demo/dist/**/*').pipe(require('gulp-gh-pages')())\""
  },

@novascreen
Copy link

i just tried this, but wanted to see if i could find a way that doesn't rely on gulp

for me this worked:

npm install --save-dev gh-pages

And in package.json:

"scripts": {
  "deploy": "gh-pages -d demo/dist"
}

I could take a stab at a PR for this if you're interested. I just found your project yesterday and i really enjoyed creating my first React component with it 👍

I guess this could be another question after the jsNext question? If you would add this i'm assuming the default should be no?

@revolunet
Copy link

would be great to have @novascreen solution in the default template

@leanne1
Copy link

leanne1 commented Nov 16, 2016

I've written up how to publish to GitHub pages here: https://notesfromthefrontend.wordpress.com/2016/11/16/publish-a-react-nwb-project-to-github-pages/

@insin insin added the docs label Jun 1, 2017
@insin
Copy link
Owner

insin commented Jun 1, 2017

This should be added to the docs now that we have working examples, thanks for those.

revolunet pushed a commit to revolunet/nwb that referenced this issue Jul 18, 2017
@tnrich
Copy link

tnrich commented Feb 13, 2018

@insin has the docs for doing this been published yet? Thanks!

@sconstantinides
Copy link

@novascreen's solution works but renaming /demo to /docs might be simpler and more obvious. Or allowing this as a nwb config.

@RavenHursT
Copy link

RavenHursT commented Aug 14, 2018

So this worked.. initially...
https://ravenhurst.github.io/react-flex-rating/

You can see my publish-demo script here: https://github.com/RavenHursT/react-flex-rating/blob/master/package.json#L21

But now I've made some updates... and while my gh-pages branch reflects those changes after running publish-demo again, the page still doesn't.

For example..

I have these transitions in the compiled css https://github.com/RavenHursT/react-flex-rating/blob/gh-pages/demo.c79dc9cc.css:
image

But the css on the generated GH-page looks like an old version w/o the transitions: https://ravenhurst.github.io/react-flex-rating/demo.c79dc9cc.css

Is there some kind of caching or something keeping me from seeing the changes?

@revolunet
Copy link

The gh-pages can take up to 10 minutes to update.

Looks like the transitions are there too now

@RavenHursT
Copy link

Nope.. I did this yesterday, and the transitions still aren't there... also.. there's a min-width on the dropdowns to keep the labels from wrapping that aren't there either... 🤔

@revolunet
Copy link

revolunet commented Aug 15, 2018

this is what i have atm :

.rating .rating-icon{cursor:pointer;position:relative;display:inline-block}.rating.disabled{opacity:.5}.font-size-0{font-size:0!important}.font-size-0-5{font-size:.5rem!important}.font-size-1{font-size:1rem!important}.font-size-1-5{font-size:1.5rem!important}.font-size-2{font-size:2rem!important}.font-size-2-5{font-size:2.5rem!important}.font-size-3{font-size:3rem!important}.font-size-3-5{font-size:3.5rem!important}.font-size-4{font-size:4rem!important}.font-size-4-5{font-size:4.5rem!important}.font-size-5{font-size:5rem!important}.font-size-5-5{font-size:5.5rem!important}.font-size-6{font-size:6rem!important}.font-size-6-5{font-size:6.5rem!important}.font-size-7{font-size:7rem!important}.font-size-7-5{font-size:7.5rem!important}.font-size-8{font-size:8rem!important}.font-size-8-5{font-size:8.5rem!important}.font-size-9{font-size:9rem!important}.font-size-9-5{font-size:9.5rem!important}.font-size-10{font-size:10rem!important}.font-size-10-5{font-size:10.5rem!important}#demo .html-entities-rating{font-size:2rem}#demo .MuiFormControl-root-1{min-width:8em}#demo .rating .rating-icon>span>span{-webkit-transition:color .15s;-o-transition:color .15s;transition:color .15s}#demo .rating .rating-icon .display-icon{-webkit-transition:width 50ms;-o-transition:width 50ms;transition:width 50ms}#demo .rating .rating-icon .background-icon>span{color:#494949}#demo .rating .rating-icon .background-icon.highlight>span{color:#ffd34c}#demo .rating .rating-icon.active .display-icon>span,#demo .rating .rating-icon.half .display-icon>span{color:#db9f33}#demo .rating .rating-icon.highlight .display-icon>span{color:#ffd34c}
/*# sourceMappingURL=demo.c79dc9cc.css.map*/

also, the hash in the filename should prevent any cache issue

@RavenHursT
Copy link

Ok.. weird.. you are correct!

What's odd now, is how the classnames on the elements are now totally different!

image

Locally.. running the demo, the markup looks like this.. the class names are all different.

image

No wonder why the css isn't getting applied properly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants