Updating Jekyll in GitHub Pages
I was getting security warnings from my github pages commits from the dependabot about a kramdown dependency.
I thought it would be easy to fix, but nah, it was easier to just reinstall everything.
I don’t have time to learn the ins-and-outs of Ruby and Jekyll, so here is my dirty (but long winded) fix…
TL;DR
- Setup a Jekyll Sandbox
- Setup GIT with Chocolatey
- Install Ruby Dev tools and Jekyll
- Clone and backup your website
- Make a new jekyll website
- Restore your blogs and stuff
- Credits
Setup a Jekyll Sandbox
I do this in a sandbox on Windows 10 because I dont really want Ruby on my day-to-day pc when I only use it every 18 months or so…
I am absolutely sure that this could be done in a Github-Codespace-container-thing and I’m really looking forward to updating this someday.
- Make sure you have Win10 and Sandboxes enabled.
- Make a file called
SandBox.wsb
with this content:
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Users\Jon\Desktop\GIT\Sandbox-Jekyll</HostFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
</Configuration>
Setup GIT with Chocolatey
In the sandbox, run this in the Powershell ISE as steps
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Then install Git
choco install notepadplusplus -y
choco install git -y
choco install tortoisegit -y
Install Ruby Dev tools and Jekyll
- Install Ruby from the installer - I used
rubyinstaller-devkit-3.0.1-1-x64.exe
- Run
ridk install
to setup MSYS2 and dev toolchain- This is option 3 on the cmd window installer
- Install Jekyll with
gem install jekyll bundler
in a new cmd window- Check with
jekyll -v
- Check with
Clone and backup your website
- Clone to sandbox
- I use TortoiseGit
- Delete everything except:
.git
folder!!_posts
folderCNAME
file_config.yml
FinnAngelo.github.io.code-workspace
fileabout.markdown
andindex.markdown
if you have changed them
- Move everything except the
.git
folder out
Make a new jekyll website
- Navigate the cmd window to the website folder
- Make a new jekyll website with
jekyll new .
- Replace the
gem "jekyll"
withgem "github-pages"
in the gemfile as per instructions on link- Dont forget the version bit
- Run
bundle update
Restore your blogs and stuff
- Put everything back except the
_config.yml
- Put all the missing bits back into the
_config.yml
from the backup - Commit
- Check renames
- Push
Credits
If you find this useful, go be nice to someone. Pay it forward.
Cheers!