Set author image to cat avatar; introduce gcrypt to compute hash
configure.ac
17 | 17 | AC_MSG_ERROR([The Guile bindings of libgit2 are missing; please install them.]) | |
18 | 18 | fi | |
19 | 19 | ||
20 | + | GUILE_MODULE_AVAILABLE([have_gcrypt], [(gcrypt hash)]) | |
21 | + | if test "x$have_gcrypt" != "xyes"; then | |
22 | + | AC_MSG_ERROR([The Guile bindings of Gcrypt are missing; please install them.]) | |
23 | + | fi | |
24 | + | ||
20 | 25 | GUILE_MODULE_AVAILABLE([have_gnutls], [(gnutls)]) | |
21 | 26 | if test "x$have_gnutls" != "xyes"; then | |
22 | 27 | AC_MSG_ERROR([The Guile bindings of GnuTLS are missing; please install them.]) |
gitile/pages.scm
16 | 16 | ;;;; | |
17 | 17 | ||
18 | 18 | (define-module (gitile pages) | |
19 | + | #:use-module (gcrypt base16) | |
20 | + | #:use-module (gcrypt hash) | |
19 | 21 | #:use-module (gitile repo) | |
20 | 22 | #:use-module (git) | |
21 | 23 | #:use-module (git types) | |
… | |||
110 | 112 | ,(project-files repository-name repo))) | |
111 | 113 | ||
112 | 114 | (define (author-image author) | |
113 | - | "/images/unknown.png") | |
115 | + | (string-append "https://avatar.lepiller.eu/cat-avatar-generator.php?seed=" | |
116 | + | (bytevector->base16-string | |
117 | + | (bytevector-hash | |
118 | + | (string->utf8 (signature-email author)) | |
119 | + | (hash-algorithm sha1))))) | |
114 | 120 | ||
115 | 121 | (define (commit->date-string commit) | |
116 | 122 | (date->string | |
… | |||
139 | 145 | ,(string-take (oid->string (commit-id commit)) 7)) | |
140 | 146 | (button (@ (data-clipboard-copy ,(oid->string (commit-id commit))) | |
141 | 147 | (class "copy")) | |
142 | - | (img (@ (src "/images/copy.png")))) | |
148 | + | (img (@ (src "/images/copy.svg")))) | |
143 | 149 | ,(if open? | |
144 | 150 | `(a (@ (href "/" ,repository-name "/tree/" | |
145 | 151 | ,(oid->string (commit-id commit)))) | |
146 | - | (img (@ (src "/images/go.png")))) | |
152 | + | (img (@ (src "/images/go.svg")))) | |
147 | 153 | '())))) | |
148 | 154 | ||
149 | 155 | (define (project-commits repository-name repo ref) |
guix.scm
19 | 19 | (guix licenses) | |
20 | 20 | (guix build-system gnu) | |
21 | 21 | (gnu packages autotools) | |
22 | + | (gnu packages gnupg) | |
22 | 23 | (gnu packages guile) | |
23 | 24 | (gnu packages guile-xyz) | |
24 | 25 | (gnu packages pkg-config) | |
… | |||
31 | 32 | (build-system gnu-build-system) | |
32 | 33 | (inputs | |
33 | 34 | `(("guile-git" ,guile-git) | |
35 | + | ("guile-gcrypt" ,guile-gcrypt) | |
34 | 36 | ("gnutls" ,gnutls) | |
35 | 37 | ("guile-fibers" ,guile-fibers))) | |
36 | 38 | (native-inputs |