Publishing a static website with GitHub pages and Jekyll.
If you are looking for a tool to host static websites, look no further. With a free GitHub account, it becomes possible to host your own website. GitHub Pages is a platform that allows users to easily create and publish websites using the power of Git and GitHub. In addition to standard HTML and CSS websites, GitHub Pages also supports Jekyll, a static site generator that simplifies the process of creating and maintaining a website. With Jekyll and GitHub Pages, it is possible for you to create and publish a website with minimal effort and zero cost.
Step 1: Create a GitHub account
The first step in creating a website using GitHub Pages and Jekyll is to create a GitHub account. This can be done by visiting the GitHub website and following the prompts to create a new account. Please go through my previous article, regarding the usage of GitHub.
Step 2: Create a new repository
Once you have a GitHub account, you can create a new repository to host your website. To do this, click on the “+” button in the top right corner of the GitHub website and select “New repository.” Give your repository a name, choose “Public” repository, then click on “Create repository”.
Step 3: Install Jekyll
To use Jekyll with GitHub Pages, you’ll need to install it on your local machine. This can be done by following the instructions on the Jekyll website, which will vary depending on your operating system. For example, if you are using Ubuntu Linux these follow these steps:
sudo apt-get install ruby-full build-essential zlib1g-dev
gem install jekyll bundler
Step 4: Create your website
With Jekyll installed, you can now create your website. This can be done by creating a new Jekyll project, or by using an existing Jekyll template. Once your website is complete, you can then push the files to your GitHub repository.
jekyll new mywebsite
Step 5: Enable GitHub Pages. To enable GitHub Pages for your repository, navigate to the repository settings on the GitHub website and select the “GitHub Pages” option. From there, you can choose a branch to use for GitHub Pages and configure other settings as needed. Now you just need to clone this repository to your computer and put the contents of ‘mywebsite’ into this repository.
Step 6: Publish your website With GitHub Pages enabled, your website will be live at a URL in the format https://<yourusername>.github.io/<yourreponame>
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/<username>/<reponame>.git
git push -u origin master
You may have a look at the websites providing templates for Jekyll themes such as :
in order to decide how to theme your website.
Step 7: In order to host a website on a domain of your choice, you may use custom domains on GitHub pages. For this, go to “Github pages” and select the custom domain option. This will enable your custom domain to point it to your site hosted through GitHub. Please note that you need to configure your domain provider to point it to GitHub pages.
By following these steps, you can easily create and publish a website using GitHub Pages and Jekyll. With the power of Git and GitHub, it is easy to make updates and changes to your website, and with Jekyll, it is easy to create and maintain a professional-looking static website.