For getting slidify onto github, if git is set up properly and available as a PATH variable it should all work pretty smoothly, for example with the publish command. On the other hand, if git is properly setup (I’m looking at you, many Windows installations) it can all go wrong and you wind up in a tangle. I’ve written this from the perspective you got solidify working, then it all turned to custard.
For a starting point let’s assume we have a folder on our computer with our slidify project,
and pick up from there.
We go off to GitHub, log in and create a new repo.
I added a README when I created the Repo but that is not critical.
I am now going to do something else which is entirely optional but will make it easier to see that we are doing the correct thing as we go.
Back in the repo contents, there is a plus sign above the list of files in the repo which lets you add text files.
I am clicking on it, and in the text editing window creating a text file called index.html
I gave it the name index.html, a little bit a default text, and a commit message of “making index.html” and clicked the Commit New File button.
So now my repo has two files in it the README.md and the index.html
Now we turn back to our own computer, and back to the non-optional things. I create a new empty folder completely different from the slidify project (because that earlier one went wrong, we are going to start over)
I go into the command line/ git setup app and set up this folder for use with GitHub, and make sure my folder matches what is already there.
If it all worked fine, the local folder has the two files from GitHub
so we know the connection to GitHub is working.
Now we copy all the visible files from the slidify folder into our new folder (as there may be invisible files with bad settings, we are abandoning them)
Most computers will ask if we want to replace the index.html that was there, and we do.
Next it is back to git commands to load up what we have done
We have a look on GitHub to confirm all is good and our files are there, to check things are still going fine.
and if we can see our files on GitHub, things are good.
At this point, one our own computer in the new solidify folder where are files are, we need to create a .nojekyll file.
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
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
Then close the file so you don’t accidentally put stuff in it.
Now we do our almost typical updating the repo commands to add the file to GitHub, something like:
We are being fairly specific about the git add command since some systems will want to leave the .nojekyll alone, so we add it by name
We check it has safely arrived on GitHub because we should now see the .nojekyll file in our repo
Now we want to make a web branch of our project that will show up in the web browser
Still using git commands in the project folder on our own computer, we set up a web branch of our project with
With one more command, we copy the files into the web branch
Then we wait for a very long ten minutes, and check our page at http://USERNAME.github.io/REPONAME/HTMLFILENAME
So not all this is necessary, but there is very little that (I think) can go wrong with it, and I have actually added a few steps that are not needed, but does mean that if something does go wrong it is very easy to figure out what it is that has gone wrong, because we are doing things one step at a time and checking.