Windows - Linux - Powershell
Inspired by a friend of mine, I wanted to create a site for my own personal use that met the following needs:
Perhaps the easiest part of all of this was creating a site out of a repo on Github.
It’s as simple as: create a repo, go to settings, Github Pages, select a branch and save.
That’s it, the repo will be accessible at: $user.github.io/repo
Furthermore, if you add a custom domain and update it’s DNS accordingly, you can have a genuine website with even an SSL
Setting up DNS was really easy. Github has a help article going into more detail
https://help.github.com/en/articles/setting-up-an-apex-domain#configuring-a-records-with-your-dns-provider
A
records for your domain to:
C-NAME
for the non-www domainI decided to go with Jekyll since Github Pages supports rendering it natively, without the need to only publish the output directory that is common with many other static site generators.
Install Ruby
sudo apt install git ruby-full build-essential zlib1g-dev
Configure Ruby
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Install Ruby Gems
gem install jekyll bundler
Clone existing repo
cd ~/
git clone https://github.com/$User/$Repo.git $Site
Create a new site
cd ~/
jekyll new <SiteName> --force
cd <SiteName>
Check for updates
bundle install
bundle update
Start Jekyll server
bundle exec jekyll serve --watch --force_polling --host=<IP>
Load Jekyll site
http://127.0.0.1:4000
It takes a little bit, but working with Jekyll is very easy.
I’ve found these resources helpful in getting to understand Jekyll.
https://jekyllrb.com/docs/
https://jekyllrb.com/docs/variables/
https://idratherbewriting.com/documentation-theme-jekyll/mydoc_conditional_logic.html