Github pages: ruby memo (and git/github push)

blog linux arch ruby github-pages

Written on June 30, 2021

Because I always forget how to update this space…

BTW, I use arch…

Update 2022-10 : did it get easier?

Source: docs.github.com: Testing your GitHub Pages site locally with Jekyll

  • cd /PATH/TO/YOUR/JEKYLL/PROJECT

Run

  • bundle exec jekyll serve

Update

  • bundle update github-pages

Install

  • bundle install
  • bundle add webrick

Git 2 github

  • git add .
  • git commit
  • git push

GitHub Flavored Markdown Spec

https://github.github.com/gfm

GitHub Flavored Markdown, often shortened as GFM, is the dialect of Markdown that is currently supported for user content.


It seems that below information is outdated / no more needed.

Archive 2021-06

Run now!

  • cd /PATH/TO/YOUR/JEKYLL/PROJECT

Jekyll:

  • bundle-2.7 exec jekyll serve

SSH/Agent:

  • ssh-agent -s
  • $SSH_AUTH_SOCK="/tmp/ssh-XXXXXXHell0/agent.12345"
  • $SSH_AGENT_PID=12345;

Git:

  • git add .
  • git commit
  • git push

Setup

Install Ruby 2.7 + Jekyll

source: ArchLinux Forum » Newbie Corner » Solved “bundle exec jekyll serve” crashes

  • sudo pacman -S ruby2.7
  • cd /PATH/TO/YOUR/JEKYLL/PROJECT bundle-2.7 install

Github: create key

Generating a new SSH key and adding it to the ssh-agent

Start the ssh-agent in the background.

eval "$(ssh-agent -s)" Agent pid 59566

Add your SSH private key to the ssh-agent.

ssh-add ~/.ssh/id_ed25519

ssh-agent output

SSH_AUTH_SOCK=/tmp/ssh-XXXXXXOJAapU/agent.27281; export SSH_AUTH_SOCK; SSH_AGENT_PID=27282; export SSH_AGENT_PID; echo Agent pid 27282;

ArchLinux

gh : alias / function to launch ss-agent and update environment variables!

# SSH (Github) and virtual env helpers ----------------------------------------
def ssh_agent():
    import re
    if 'SSH_AUTH_SOCK' in ${...} and 'SSH_AGENT_PID' in ${...}:
        print("SSH_AUTH_SOCK = ", $SSH_AUTH_SOCK)
        print("SSH_AGENT_PID = ", $SSH_AGENT_PID)
	return

    ssh_agent_txt = $(ssh-agent -s)

    for export_env in ssh_agent_txt.split("\n"):
        param_value = list(filter(None, re.split("([^=]+)=([^;]+).*", export_env)))
        if len(param_value) == 2:
           ${param_value[0]} = param_value[1]
           print(param_value[0], " = ", param_value[1])

    ssh-add
    ssh-add ~/.ssh/id_rsa_github

aliases['gh'] = ssh_agent
aliases['vh'] = ['source-bash', './bin/activate']


◀ ArchLinux: pacman hook (to see the description) ■ ■ ■ Linux tools for 2022 ▶


In the same category: