Giter VIP home page Giter VIP logo

ulti-mate-page's Introduction

See create-react-app page for basic README.md file.

Basic setup that many website have consistently discussed

  1. Set a "homepage" property in your package.json file, and set it to "https://[your-user-name].github.io/[your-repo-name]".
  2. Add a few extra "scripts":
    • "predeploy": "npm run build" - specifies the command to build before deployment. This just runs the "build" script.
    • "deploy": "gh-pages -d build" - specifies which branch and directory to deploy.
  3. Install the gh-pages package with npm install --save-dev gh-pages
  4. To get your app onto github pages, just run npm run deploy, and then your app should be running on the link you just set in homepage above.

Things learned while messing around:

  1. Not easy to use BrowserRouter with gh-pages - until this point, haven't found a need for it, so just use HashRouter.
  2. If page doesn't update quickly, you can almost instantly update it by going to ...page/index, hard refreshing the page (Ctrl + Shift + R), then going back to the root route '/' and hard refreshing that url.
    • Example: if your root route is https://<github username>.github.io/my-repo, first go to https://<github username>.github.io/my-repo/index, do a hard refresh (at this point your app should be working), then go back to https://<github username>.github.io/my-repo and do another hard refresh - your app should be working - at least, this works for me.
  3. Jss (Css in javascript) doesn't easily do content: ' ' when adding the :before / :after pseudoclasses - remember you have to do content: '" "' to actually keep the double-quotes in the string.

Some useful websites for getting a react app on Github Pages

  1. Blog on codeburst.io - very useful intro steps and explanations, but didn't explain the BrowserRouter / hard refresh issues I ran into.
  2. Blog on itnext.io - has some interesting commentary about getting BrowserRouter to work, but I haven't tried it yet.
  3. react-github-pages - some boiler plate code for getting a react app set up in Github Pages
  4. sample-react-github-pages - sample react app set up with github pages (including video link with some extra explanation)

ulti-mate-page's People

Contributors

beamanator avatar

Watchers

 avatar  avatar

ulti-mate-page's Issues

Make adaptable for multiple languages

Idea = anywhere text should be displayed (example: <h4>Name / Location</h4>), change the text with:

<h4>{textPiece.<name>.<lang>}</h4>

Where:

  1. textPiece is a dictionary of strings
  2. <name> is a string key name (like ADD_PICKUP_TABLE_GROUP_TITLE_NAME_LOCATION)
  3. <lang> is the language needed, probably stored in global settings / redux (English / Arabic would be first 2 languages)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.