QuickRef: My posting process
Because otherwise I’ll forget….
Now I’ve got Jekyll and Github setup properly1, here’s what I need to go through to generate a new blogpost:
From Home
- Prep environment:
- Log in to
hotboi.local
- Prepare github key (
source ~/.ssh/prep_github_key.sh
) cd henley-regatta.github.io
git checkout gh-pages
to switch to the correct branchgit pull
and check all updates apply correctly.
- Log in to
- Create a post
- Create a file in
_posts
with formatYYYY-MM-DD-SomePostTitle.md
- Edit the file in Your Favourite Editor.
- Set the correct metadata by ensuring the following is set at the TOP of the file:
--- layout: post title: "Title of the Blog Post Hopefully Matching SomePostTitle.md Filename" date: 2021-04-09 15:36:00 +0100 categories: howto tags: siteadmin jekyll howto ---
(Adjust all except
layout: post
to match what’s being written about and when) - Add the blog entry in Markdown
below the second
---
YAML delimiter - Save the file.
- Create a file in
- Test locally
- From a shell on hotboi:
cd ~/henley-regatta.github.io
bundle exec jekyll serve -H hotboi
- From a Web Browser: http://hotboi.local:4000/
- Navigate to new content page from the index, verify contents.
- Re-edit the file and change until the contents render as desired2
- From a shell on hotboi:
- Commit and Publish from hotboi:
cd ~/henley-regatta.github.io
git add _posts/*
(if you’re brave;git add _posts/YYYY-MM-DD-SomePostTitle.md
if you’re not)git commit -a -m "Added new blog post SomePostTitle"
git push
to publish to github and thence the world.
- Verify publish in a Browser by visiting https://www.guided-naafi.org/ and navigating to the post3.
From Github.com
- Login at Github
- Switch to
henley-regatta.github.io
repository - Go to the
_posts
folder - Make sure the gh-pages branch is set to current.
- Use the Add Files button to add a Markdown file with the format
YYYY-MM-DD-SomePostTitle.md
- See “Create a Post” above to create.
- Make sure to Commit the file with an appropriate comment to the gh-pages branch
- Open https://www.guided-naafi.org/ and navigate to the post to check.
- (Repeat steps 6-8 until you’ve got it right.)3
Common Factors
Images
By convention, external assets for a page such as images are put into the assets
sub-directory (~/henley-regatta.github.io/assets
on hotboi, the assets
folder of the henley-regatta.github.io
repository on github).
Within a post, it’s probably best to use the reference-link form of embedding
to make post reading easiest. For a picture in assets
called MyGnarlyPortrait.jpg
a suitable markdown fragment would be:
Hey I wanted to show you this completely radical picture I found:
![Gnarly Portrait Of Me]
blah blah blah
blah rest of post blah
[Gnarly Portrait Of Me]: (/assets/MyGnarlyPortrait.jpg)
{:style="display: block; margin: auto; width: 50%;"}
Note that the text in the initial reference is used as ALT text for the picture so should be descriptive rather than referential.
Favicon
Shouldn’t need to worry about this but the process for adding a Favicon makes me wonder whether I’m going to get into trouble with it later. I started from the last answer from StackOverflow to achieve this with my preferred PNG icon:
…And discovered that the documented process is in transition at the minute so instructions for Minima 2.50 are too complex but 3.xx don’t work. So the additional steps required were:
- Create directory
~/henley-regatta.github.io/_includes
cp ~/gems/gems/minima-2.5.1/_includes/head.html ~/henley-regatta.github.io/_includes/head.html
- Add the line
<link rel="shortcut icon" type="image/png" href="https://henley-regatta.github.io//assets/favicon.png">
directly under the<head>
tag inhead.html
- Commit and republish
-
I hope…. ↩
-
The local Jekyll server instance can be left running if remote editing is being performed; it’ll automatically sense file changes and re-build as required ↩
-
Apparently, all of this is so much easier than editing and publishing raw HTML. Or using Blogger. Or a Wiki…. So I’m told anyway. ↩ ↩2