diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 7b41d5f..bb6fbd4 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -23,9 +23,11 @@
{{ if in site.Params.avatar "http" }}
{{ $.Scratch.Set "avatar_url" site.Params.avatar }}
{{ else }}
+{{ $official_cdn := "https://www.gravatar.com/avatar/" }}
+{{ $cdn := (site.Params.gravatarCdn | default $official_cdn) }}
{{ $md5 := (md5 site.Params.avatar) }}
-{{ $url := print "https://www.gravatar.com/avatar/" $md5 "?s=160&d=identicon" }}
-{{ $.Scratch.Set "avatar_url" $url }}
+{{ $avatar_url := print $cdn $md5 "?s=160&d=identicon" }}
+{{ $.Scratch.Set "avatar_url" $avatar_url }}
{{ end }}
{{ end }}