Skip to content

eengstrom/eengstrom.github.io

Repository files navigation

Irregular Motif

This is the "source" repo for my personal ramblings and random postings which is hosted via GitHub Pages using Jekyll and Minima Theme. Content in this repo and on my website is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

Anything else below are simply my (meta-)notes on how I set things up or other random GitHub Pages or Jekyll references.


META Notes

Regular References

Regular Usage

  • run ./serve.sh,
  • add posts(s) to _posts using newpost.sh Tile of the new post,
  • ... iterate ...
  • add, commit, and push to GitHub, which implicitly publishes.

Setup

  • Create a repository on GitHub called USER.github.io, or via GitHub's API (c.f. this)

    curl -u 'eengstrom' https://api.github.com/user/repos -d '{"name":"eengstrom.github.io"}'
    git clone [email protected]:eengstrom/eengstrom.github.io.git
    cd eengstrom.github.io
    git remote rename origin github
    git branch jekyll-setup
    git push -u github jekyll-setup
    
  • Install Ruby and Jekyll

    brew install ruby
    prepend PATH ${BREW_HOME:-}/opt/ruby/bin
    gem install bundler jekyll
    prepend PATH ${BREW_HOME:-}/lib/ruby/gems/2.5.0/bin
    
  • Create new jekyll

    jekyll new .
    # edit `Gemfile` and uncomment `gem "github-pages" ...`
    

Customizations

Crimson

I'm using #DC143C as my color code for many things.

Adding favicons

Followed Jekyll Minima Docs, using RealFavIconGenerator.net, with modified icons from The Noun Project (under CC-by, by Laura Breier).

Modifying stock headers/footers

Tips from Jekyll Minima Docs

mkdir _includes
cp -p $(bundle show minima)/_includes/footer.html _includes
edit _includes/footer.html

Migrate from self-hosted Wordpress

Using Jekyll's wordpress importer, and a bit of hackery:

gem install --user-install unidecode sequel mysql2 htmlentities jekyll-import
# https://serverfault.com/questions/127794/forward-local-port-or-socket-file-to-remote-socket-file
socat "UNIX-LISTEN:./mysqld.sock,reuseaddr,fork" \
      EXEC:'ssh [email protected] socat STDIO UNIX-CONNECT\:/var/run/mysqld/mysqld.sock'
# test
#mysql -S ./mysqld.sock -u USER -p
# convert
ruby -r rubygems -e 'require "jekyll-import";
   JekyllImport::Importers::WordPress.run({
       "dbname"         => "DBNAME",
       "user"           => "USER",
       "password"       => "PASSWORD",
       "host"           => "localhost",
       "port"           => "3306",
       "table_prefix"   => "wp_",
       "socket"         => "./mysqld.sock",
    })'
cd _posts
dos2unix *
# https://github.com/aaronsw/html2text
pip install html2text
for f in *.html; do
   md=$(echo "$f" | sed 's/html$/md/')
   (
     awk '/---/ {mark++} mark<=1' < "$f";
     echo "---"
     awk '/---/ {mark++} mark>=2' < "$f" \
       | html2text - \
       | tail -n +2
   ) >"$md"
done
mv *.md ../../_posts

Things to investigate

About

My personal ramblings in blog form

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published