zer0-mistakes with github-pages and jekyll

Prerequsites

Github Account

Signup or Sign-in

Master Setup

Install package manager:

Install Git

Install Github cli

Set your variables

export GITHOME=~/github
export GHUSER=bamr87
export GIT_REPO=$GHUSER.github.io
export ZREPO=$GITHOME/$GIT_REPO
echo $GITHOME $ZREPO $GHUSER $GIT_REPO

git config --global user.email "$GHUSER@users.noreply.github.com"
git config --global user.name "$GHUSER"

Initialize your new github repository

gh cli docs

cd ~
mkdir $GITHOME
cd $GITHOME
mkdir $GIT_REPO
cd $ZREPO
# If repo already exists
cd $ZREPO
gh repo clone $GHUSER/$GIT_REPO
# If new repo
cd $ZREPO
git init
echo "# Building new report from $ZREPO" >> README.md
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/$GHUSER/$GHUSER.github.io.git
git push -u origin main

Checkpoint - Github Repo Initialized

# non-github.io version
gh repo create $GIT_REPO --public --source=. --remote=upstream
git remote add origin https://$GHUSER@github.com/$GHUSER/$GIT_REPO.git

Initialize Jekyll - If New Repo

Install jekyll

cd $ZREPO
jekyll new ./ --force
bundle install
# If running MacOS
bundle add webrick
bundle install
jekyll serve

Initialize Jekyll - If Existing Repo

cd $ZREPO
bundle update
bundle install
jekyll serve

Checkpoint - Jekyll Initialized

code _config.yml
title: zer0-mistakes
email: bamr87@zer0-mistakes.com
description: >- # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: bamr87
github_username:  bamr87
cd $ZREPO
wget https://raw.githubusercontent.com/bamr87/it-journey/master/favicon.ico

Checkpoint 1

bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32 java

Override default

https://jekyllrb.com/docs/themes/#overriding-theme-defaults

# find theme path
bundle info --path minima
JEKYLL_THEME=$(bundle info --path minima)
echo $JEKYLL_THEME
cd $JEKYLL_THEME

Copy theme repo

cp -aR $JEKYLL_THEME/* $ZREPO

Remove Theme plugin

bundle remove jekyll-theme-minima

Comment out the theme from config and Gemfile

#_config.yml
# Build settings
# theme: minima
plugins:
  - jekyll-feed
bundle remove minima --install

Restart jekyll

jekyll serve

Building the theme

Build default page

cd $ZREPO
mkdir _layout
cd _layout
echo "{{ content }}" >> default.html 
#tree #alias #zshrc #profile
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
echo alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" >> ~/.zshrc

tree
cd -

Download your home

d=$(date +%Y-%m-%d)
echo "$d"
cd $ZREPO/_posts
wget -O $d-home.md https://raw.githubusercontent.com/bamr87/it-journey/master/home.md