Skip to content

I am a software engineer. In my spare time I study Consciousness from a neurocomputational point of view.

License

Notifications You must be signed in to change notification settings

malcolmlett/malcolmlett.github.io

Repository files navigation

GitHub Pages Site

This is the repository for my Personal website, hosted courtesy of GitHub Pages.

This site is built with Jekyll and the Just the Docs theme.

Running locally

Works best within Windows System for Linux (WSL).

The first time you run this, you'll need to follow the "one time setup" steps below.

Then, run as follows:

  1. Run jekyll

    $ bundle exec jekyll serve --force_polling
  2. Open in a browser at http://localhost:4000

Running locally - one time setup

The following steps configure Jekyll to run within WSL.

Prerequisites:

  • make sure you are on Ubuntu 20.04.5 LTS or later

    $ lsb_release -a
  • Identify exactly which version of Ruby and Bundler is used in the GitHub Pages Actions in order to replicate the same environment locally.

Steps:

  1. Install ruby-install as per https://github.com/postmodern/ruby-install#readme

    • tip: you can download to a Downloads folder, it'll install as a globally available command when running make.
  2. Install ruby:

    $ ruby-install
    $ sudo ruby-install --system ruby 3.1.4       # or whichever version is used on GitHub Pages
    $ ruby -v
  3. Update your .bashrc to point to a local folders for gems to be installed to, as per https://jekyllrb.com/docs/troubleshooting/#no-sudo

  4. Make sure you've got the correct version of bundler:

    $ gem install bundler --version "2.3.26"      # or whichever version is used on GitHub Pages
  5. Install node.js (needed by execjs, used by Katex) as per https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-wsl

  6. Checkout and cd into the project

  7. Do bundle install

    $ bundle install

Jekyll and Just the Docs tips

Creating markdown links that open in a new tab (source):

[Mishacreatrix Website](https://mishacreatrix.com/){:target="_blank"}{:rel="noopener noreferrer"}

Random useful stuff

Sed command to wrap http urls as hyperlinks in short-hand md syntax (supported by Jekyll), without affecting existing wrapped urls:

sed -E 's/(^|[,. ])(http(s?):\/\/([^. ]|\.[^ ])+)(\.?([ ]|$))/\1<\2>\5/g' source.txt > updated.txt

Sed command to wrap http urls as hyperlinks in full-form md syntax, without affecting urls that have already been turned into hyperlinks:

sed -E 's/(^|[. ])(http(s?):\/\/([^. ]|\.[^ ])+)(\.?([ ]|$))/\1[\2](\2)\5/g' source.txt > updated.txt