chiark / gitweb /
m.gh: repository link title doesn't need to be a full URL.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Sep 2017 11:22:27 +0000 (13:22 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 12 Sep 2017 10:06:26 +0000 (12:06 +0200)
Because it's obvious what's meant.

pelican-plugins/m/gh.py

index 6b086a0c047da066eb54bcb18e25950a6c19c07d..2c34540307bbe14f13e1a0f2af07f26fc83f2c76 100644 (file)
@@ -24,7 +24,9 @@ def gh_internal(account, ref, title, link):
         if not title: title = url
     else:
         url = "https://github.com/{}/{}".format(account, ref)
-        if not title: title = url
+        if not title:
+            # if simple profile link, no need to expand to full URL
+            title = link if not '/' in ref else url
 
     return title, url