How to Run an Academic Blog with Jekyll Locally on Windows
Published:
I have chosen to start this blog to see where it takes me. Previously, I also have a Medium profile where I occasionally write about STEM-related matters and general topics, but I find it less convenient then cause I could not organize them. So, here, I’m motivated to organize everything in one place, particularly things related to STEM, academia, and engineering.
Enter Jekyll for academic blogs. I believe it’s the most convenient platform for researchers, whether for your portfolio or any other needs. Initially, I didn’t take it seriously and edited everything directly on GitHub. Sounds crazy, considering my laziness to additional installations for local website running. But somehow, it’s been worth it.
In this space, I’ll document for myself and anyone else who might feel overwhelmed by technical details (especially when you are working with Windows). And yes, I am using Windows as I run this on my own computer.
Installation
First of all you need to install, git, nodejs, and ruby on your computer. As we know, git is needed to integrate the codes we have locally and on our github. Meanwhile, the other two are needed to successfully run the academic blog locally on your computer, with Node.js for managing packages, and Ruby (with the Jekyll gem) to build and serve your Jekyll website locally.
- Install Git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Install Node.js: https://nodejs.org/
- Install Ruby: https://www.ruby-lang.org/en/documentation/installation/
Integrate Codes Locally
As mentioned, Git is important to integrate the codes on your computer with your github repository. So, after installing this dependency, first of all, you need to clone your Jekyll repository.
💡 Some advice : For me, visual studio code has always been the best app for managing and writing codes. When I first learned how to build a website during my college time, I used notepad++ 😅 That is okay, if you happen to do that now. But, rest assured, visual studio code is not that hard, rather it is so convenient. So, if you have the time to learn it or install it, go for it! I am sure this will not take a lot of time.
Now, back to the topic.
This is how you can clone your github repository using git:
git clone repository_url
for example:
git clone https://github.com/djrumala/djrumala.github.io
💡 Please note: Before you clone, please make sure that you have come to the right directory for where you want to save the codes. If you use visual studio code, it would be easy just to do it in visual studio code terminal.
So, now, when you have clone the jekyll repo, you can easily open the whole folder in it with your visual studio code. You can just write command in your visual studio code terminal:
code .
Run Jekyll Server
When everything is done and settled. Then you just need to proceed by running jekyll server in terminal with this command:
bundle exec jekyll serve
By doing this, it will generate the HTML and serve it from localhost:4000
the local server will automatically rebuild and refresh the pages on change.
💡 Please note: that you need to restart jekyll server with this command every time you modify _config.dev.yml
and when you do modify this file, please also make sure that you also modify _config.yml
.