I am an Engineer based in Pune, India. These are some of my DIY & IoT projects.
This post shows you how to clone your existing repo that has been previously been setup to serve GiHub Pages and replicate the setup on a computer with freshly installed Ubuntu so that you can continue to add pages and publish to the same repo.
sudo apt install git
git config --global user.name "Anurag Chugh"
git config --global user.email "me@email.com"
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
gh auth login
sudo apt-get install ruby-full build-essential zlib1g-dev
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
gem install jekyll bundler
gh repo clone lithiumhead/lithiumhead.github.io
cd ~/lithiumhead.github.io/docs
bundle install
nano Gemfile
223
in gem "github-pages", "~> 223"
to the latest version thats specified here. (It was 228 on 2023-11-28)bundle update
bundle add webrick # Solves https://github.com/github/pages-gem/issues/752
bundle exec jekyll serve
lithiumhead.github.io/docs/_posts/
and then add, commit and push to gh-pages branch.Post Categories: jekyll-howtos