From d668d45e9015a1717fe86ca234c0d65f4a9c8e7c Mon Sep 17 00:00:00 2001 From: Anurag Chugh Date: Tue, 28 Nov 2023 02:22:55 +0530 Subject: [PATCH] My second post on GitHub Pages Instructions on cloning your existing repo and recreating the environment on an Ubuntu Computer --- docs/Gemfile | 4 +- docs/Gemfile.lock | 148 ++++++++---------- .../_posts/2023-11-28-my-second-post.markdown | 60 +++++++ 3 files changed, 131 insertions(+), 81 deletions(-) create mode 100644 docs/_posts/2023-11-28-my-second-post.markdown diff --git a/docs/Gemfile b/docs/Gemfile index 8118352..d422d38 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -8,7 +8,7 @@ source "https://rubygems.org" # This will help ensure the proper Jekyll version is running. # Happy Jekylling! #gem "jekyll", "~> 4.2.1" -gem "github-pages", "~> 223", group: :jekyll_plugins +gem "github-pages", "~> 228", group: :jekyll_plugins # This is the default theme for new Jekyll sites. You may change this to anything you like. gem "minima", "~> 2.5" # If you want to use GitHub Pages, remove the "gem "jekyll"" above and @@ -29,3 +29,5 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +gem "webrick", "~> 1.8" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index d6248f5..f9a0486 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,63 +1,53 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.4.6) + activesupport (7.1.2) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.2.0) + bigdecimal (3.1.4) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.11.1) colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.9) - dnsruby (1.61.9) - simpleidn (~> 0.1) + commonmarker (0.23.10) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + dnsruby (1.70.0) + simpleidn (~> 0.2.1) + drb (2.2.0) + ruby2_keywords em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) eventmachine (1.2.7) - execjs (2.8.1) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + execjs (2.9.1) + faraday (2.7.12) + base64 + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - ffi (1.15.5) + faraday-net_http (3.0.2) + ffi (1.16.3) forwardable-extended (2.6.0) gemoji (3.0.1) - github-pages (223) + github-pages (228) github-pages-health-check (= 1.17.9) - jekyll (= 3.9.0) + jekyll (= 3.9.3) jekyll-avatar (= 0.7.0) jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.6) + jekyll-commonmark-ghpages (= 0.4.0) jekyll-default-layout (= 0.1.4) jekyll-feed (= 0.15.1) jekyll-gist (= 1.5.0) @@ -71,7 +61,7 @@ GEM jekyll-relative-links (= 0.6.1) jekyll-remote-theme (= 0.4.3) jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.7.1) + jekyll-seo-tag (= 2.8.0) jekyll-sitemap (= 1.4.0) jekyll-swiss (= 1.0.0) jekyll-theme-architect (= 0.2.0) @@ -89,12 +79,12 @@ GEM jekyll-theme-time-machine (= 0.2.0) jekyll-titles-from-headings (= 0.5.3) jemoji (= 0.12.0) - kramdown (= 2.3.1) + kramdown (= 2.3.2) kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.3) + liquid (= 4.0.4) mercenary (~> 0.3) minima (= 2.5.1) - nokogiri (>= 1.12.5, < 2.0) + nokogiri (>= 1.13.6, < 2.0) rouge (= 3.26.0) terminal-table (~> 1.4) github-pages-health-check (1.17.9) @@ -103,17 +93,17 @@ GEM octokit (~> 4.0) public_suffix (>= 3.0, < 5.0) typhoeus (~> 1.3) - html-pipeline (2.14.0) + html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (0.9.5) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (3.9.0) + jekyll (3.9.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (~> 0.7) + i18n (>= 0.7, < 2) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 2.0) kramdown (>= 1.17, < 3) @@ -127,13 +117,13 @@ GEM jekyll-coffeescript (1.1.1) coffee-script (~> 2.2) coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.3.1) - commonmarker (~> 0.14) - jekyll (>= 3.7, < 5.0) - jekyll-commonmark-ghpages (0.1.6) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1.2) - rouge (>= 2.0, < 4.0) + jekyll-commonmark (1.4.0) + commonmarker (~> 0.22) + jekyll-commonmark-ghpages (0.4.0) + commonmarker (~> 0.23.7) + jekyll (~> 3.9.0) + jekyll-commonmark (~> 1.4.0) + rouge (>= 2.0, < 5.0) jekyll-default-layout (0.1.4) jekyll (~> 3.0) jekyll-feed (0.15.1) @@ -164,7 +154,7 @@ GEM rubyzip (>= 1.3.0, < 3.0) jekyll-sass-converter (1.5.2) sass (~> 3.4) - jekyll-seo-tag (2.7.1) + jekyll-seo-tag (2.8.0) jekyll (>= 3.8, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) @@ -217,12 +207,12 @@ GEM gemoji (~> 3.0) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) - kramdown (2.3.1) + kramdown (2.3.2) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.3.6) @@ -230,24 +220,22 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.15.0) - multipart-post (2.1.1) - nokogiri (1.13.3-x86_64-linux) + minitest (5.20.0) + mutex_m (0.2.0) + nokogiri (1.15.5-x86_64-linux) racc (~> 1.4) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) - racc (1.6.0) - rb-fsevent (0.11.1) + public_suffix (4.0.7) + racc (1.7.3) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) + rexml (3.2.6) rouge (3.26.0) - ruby-enum (0.9.0) - i18n ruby2_keywords (0.0.5) rubyzip (2.3.2) safe_yaml (1.0.5) @@ -256,34 +244,34 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) simpleidn (0.2.1) unf (~> 0.1.4) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.9.1) unicode-display_width (1.8.0) - zeitwerk (2.5.4) + webrick (1.8.1) PLATFORMS x86_64-linux DEPENDENCIES - github-pages (~> 223) + github-pages (~> 228) jekyll-feed (~> 0.12) minima (~> 2.5) tzinfo (~> 1.2) tzinfo-data wdm (~> 0.1.1) + webrick (~> 1.8) BUNDLED WITH 2.3.8 diff --git a/docs/_posts/2023-11-28-my-second-post.markdown b/docs/_posts/2023-11-28-my-second-post.markdown new file mode 100644 index 0000000..72ac3b0 --- /dev/null +++ b/docs/_posts/2023-11-28-my-second-post.markdown @@ -0,0 +1,60 @@ +--- +layout: post +title: "My Second Post on GitHub Pages with Jekyll" +date: 2022-02-28 02:20:00 +0530 +categories: howto +--- + +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. + +References +========== + +* {% post_url 2022-02-24-my-first-post %} + +Prerequisites +============= + +* Ubuntu Computer +* Account on Github + +Cloning your existing repo and recreating the environment +========================================================= + +1. Install and setup git on your Ubuntu Computer to work with your GitHub account + 1. `sudo apt install git` + 2. `git config --global user.name "Anurag Chugh"` + 3. `git config --global user.email "me@email.com"` +2. Install Github CLI + 1. `curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg` + 2. `sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg` + 3. `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` + 4. `sudo apt update` + 5. `sudo apt install gh -y` +3. Setup Github Authentication + 1. `gh auth login` + 2. Follow on screen instructions +4. Install Ruby + 1. `sudo apt-get install ruby-full build-essential zlib1g-dev` +5. Avoid installing RubyGems packages (called gems) as the root user. + 1. `echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc` + 2. `echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc` + 3. `echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc` + 4. `source ~/.bashrc` +6. Install Jekyll and Bundler + 1. `gem install jekyll bundler` +7. Clone the repo + 1. `gh repo clone lithiumhead/lithiumhead.github.io` +8. Run commands + 1. `cd ~/lithiumhead.github.io/docs` + 2. `bundle install` +9. If your the version specified for gh-pages in your Gemfile is old, now is a good time to update it + 1. `nano Gemfile` + 2. Change the `223` in `gem "github-pages", "~> 223"` to the latest version thats specified [here](https://pages.github.com/versions/). (It was 228 on 2023-11-28) + 3. `bundle update` + 4. `bundle add webrick # Solves https://github.com/github/pages-gem/issues/752` +10. To render existing posts locally + 1. `bundle exec jekyll serve` + 2. Open [http://127.0.0.1:4000/](http://127.0.0.1:4000/) in Browser +11. To add a new post, just add a new markdown file to `lithiumhead.github.io/docs/_posts/` and then add, commit and push to gh-pages branch. +