GithubHelp home page GithubHelp logo

appleorange's Introduction

This is an example of turning a .html file generated from an Rmarkdown into a website powered by GitHub.

For a starting point let's assume we have a repo on GitHub with all our project files in it.

GitHub repo

In particular regardless of whatever other files are part of the repo, we have the finished .html version made by knitting the Rmarkdown to HTML. To turn it into a website, we have to do 3 things:

  • make a .nojekyll file and make it part of the repo
  • make a web-branch of the repo
  • add a copy of our repo to the web branch

Make a .nojekyll file

We need to create an empty file called .nojekyll in our project folder. This can be quite challenging as .files are often invisible system files that the computer does not want you tampering with. While there are different ways of doing this on various kinds of computers, we are going to use a tool everyone has on hand by using RStudio itself.

From the File menu, select New File -> Text File then immediately use the File -> Save command to save the file with the name .nojekyll

Creating a .nojekyll

Then close the file so you don't accidentally put stuff in it.

Now we do our typical updating the repo commands to add the file to GitHub, something like:

git add .nojekyll
git commit -m ".nojekyll created"
git push -u origin master

We are being fairly specific about the git add command since some systems will want to leave the .nojekyll alone

Make a web branch

Still using git commands, we set up a web branch with

git branch gh-pages

Copy our repo to the web branch

With one more command, we copy the files into the web branch

git push origin gh-pages

Then we wait for a very long ten minutes, and check our page at http://USERNAME.github.io/REPONAME/HTMLFILENAME

appleorange's People

Contributors

thoughtfulbloke avatar

Watchers

 avatar

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.