From: Vladimír Vondruš Date: Mon, 11 Sep 2017 11:22:00 +0000 (+0200) Subject: m.gh: shorten the commit link title to 7 chars of the SHA-1. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=dee60692689e70648488651ec89ba59e2b2eeebd;p=blog.git m.gh: shorten the commit link title to 7 chars of the SHA-1. --- diff --git a/pelican-plugins/m/gh.py b/pelican-plugins/m/gh.py index 9db3bccd..6b086a0c 100644 --- a/pelican-plugins/m/gh.py +++ b/pelican-plugins/m/gh.py @@ -13,7 +13,7 @@ def gh_internal(account, ref, title, link): elif '@' in ref: project, _, commit = ref.partition('@') url = base_url.format(account, project, "commit", commit) - if not title: title = link + if not title: title = account + "/" + project + "@" + commit[0:7] elif '$' in ref: project, _, branch = ref.partition('$') url = base_url.format(account, project, "tree", branch)