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.
- On setting up GitHub Pages and Jekyll,
- ... largely following "Setting up GitHub Pages locally with Jekyll",
- ... and building on Jekyll on GitHub Pages,
- ... using tips/pointers from Jonathan McGlone (just a random find),
- ... to eventually use the combination for blogging using GitHub GISTs.
- run
./serve.sh
, - add posts(s) to
_posts
usingnewpost.sh Tile of the new post
, - ... iterate ...
add
,commit
, andpush
to GitHub, which implicitly publishes.
-
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" ...`
I'm using #DC143C
as my color code for many things.
Followed Jekyll Minima Docs, using RealFavIconGenerator.net, with modified icons from The Noun Project (under CC-by, by Laura Breier).
Tips from Jekyll Minima Docs
mkdir _includes
cp -p $(bundle show minima)/_includes/footer.html _includes
edit _includes/footer.html
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
- tag cloud(s)
- https://stackoverflow.com/questions/45769857/css-to-add-to-jekyll-minima-not-completely-override-it?rq=1
- add CV and other ideas from:
- http://getbootstrap.com/getting-started/
- https://experimentingwithcode.com/creating-a-jekyll-blog-with-bootstrap-4-and-sass-part-1/
- line numbering code blocks