🏡 index : ~doyle/rgit.git

author Jordan Doyle <jordan@doyle.la> 2022-07-17 21:19:36.0 +01:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-07-17 21:19:36.0 +01:00:00
commit
dada791df64c6fe5ef6e447da817d8e0fb2db255 [patch]
tree
0d906dee2293a289e29dd9fc6dad1b33bb490020
parent
595fd116b0c71b623d13dafe6d9d5f2cd4526ff3
download
dada791df64c6fe5ef6e447da817d8e0fb2db255.tar.gz

Fix gravatar on reflog



Diff

 src/methods/filters.rs  | 4 ++++
 templates/repo/log.html | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/methods/filters.rs b/src/methods/filters.rs
index 3287bf4..58df841 100644
--- a/src/methods/filters.rs
+++ a/src/methods/filters.rs
@@ -9,3 +9,7 @@
pub fn hex(s: &[u8]) -> Result<String, askama::Error> {
    Ok(hex::encode(s))
}

pub fn md5(s: &str) -> Result<String, askama::Error> {
    Ok(hex::encode(&md5::compute(s).0))
}
diff --git a/templates/repo/log.html b/templates/repo/log.html
index 4239127..2d8167d 100644
--- a/templates/repo/log.html
+++ a/templates/repo/log.html
@@ -22,7 +22,7 @@
        </td>
        <td><a href="/{{ repo.display() }}/commit/?id={{ commit.hash|hex }}">{{ commit.summary }}</a></td>
        <td>
            <img src="https://www.gravatar.com/avatar/{{ commit.author.email }}?s=13&d=retro" width="13" height="13">
            <img src="https://www.gravatar.com/avatar/{{ commit.author.email|md5 }}?s=13&d=retro" width="13" height="13">
            {{ commit.author.name }}
        </td>
    </tr>