DEV Community

Discussion on: Tools I Use For Blogging

Collapse
 
gbscode profile image
Babafemi Sorinolu

Hi. Thanks for this great post. I took some steps in trying to create myself a page.
How do I setup the Jasper2 theme on my page?

Collapse
 
bauripalash profile image
Palash Bauri 👻

Setting up Jasper2 theme was really even tough for me, it took me a whole day to correctly configure all the things.

Hold Tight this is gonna take a little bit extra time...

I'm assuming that you're able to work with git, github and Jekyll.

First clone the Jasper 2 Github Repo locally, then delete the .git folder .

Configure the site according to you need such as changing title, author etc. and don't forget to delete all the posts.

Try running the site locally to see if everything works fine or not, if it's not messed up it should work fine.

Now initialise a git repo there and create a commit. Create a repo with such as username.github.io , where username is your GitHub username. Then push the local files to GitHub repo.

Create another branch named dev as same as master branch , both locally and on GitHub. Sync them properly.

Then go to the settings of the GitHub repo and set dev as default branch.

In local repo, open up the file Rakefile and on line 16 change DESTINATION_BRANCH = "gh-pages" to DESTINATION_BRANCH = "master"

Now save the file. And open _config.yml and on line 71 change branch: master to branch: dev

Don't forget to change username on line 69 and repo on 70 according to yours.

If you've done the setup correctly try opening, username.github.io , you'll see a simple page , but don't cheer up now hard work is still ahead. Your page is not yet working perfectly now, if you have any post now, you can't read them right now.

To make it work perfectly we have to use Travis-CI (you can use other CI , but setting up Travis-CI was easy)

First login to your Travis-CI dashboard and enable the repo you're using.

Then open this link github.com/settings/tokens and create a token (don't forget to give it a name)..

Don't close the tab for now, now head to the local repo, switch branch to dev then Open the file .ttavis.yml and on line 20 delete the secure thing.

Now open up the terminal there, and install the travis ruby gem with gem install travis (use sudo if needed)

Now, execute this command , travis encrypt 'GIT_NAME="YOUR_USERNAME" GIT_EMAIL="YOUR_EMAIL" GH_TOKEN=YOUR_TOKEN'

Replace YOUR_USERNAME with your GitHub username

Replace YOUR_EMAIL with your email address you used to sign-up in GitHub

Replace YOUR_TOKEN with the token you got few minutes ago (your tab is still open)

After running this command you'll get another secure thing , copy it from terminal and put it back where the old secure thing was.

On line 23 of .travis.yml replace master with dev

Push the changes to GitHub , head over to Travis-CI and see if it's building your site.

I think everything is okay, Travis-CI will build your site within few minutes and your site will be live.

(I apologise if something is not working, i setup my site a long time ago and I forgot how exactly I setup it. Let me know if it works or not)

Collapse
 
gbscode profile image
Babafemi Sorinolu

Thanks, i am going to follow your steps and will get back to you if i encounter issues

Collapse
 
hanykowska profile image
hanykowska

This worked!!! I'm so happy. It took me sooooo long to set jasper2 on my local disk and then it turned out it doesn't work on gh-pages... Not anymore! Thanks so much for this post!