@@ -50,15 +50,20 @@ def page_authors_summary(page, config: dict):
5050
5151 authors = page .get_authors ()
5252 authors_summary = []
53+ author_name = ""
54+
5355 for author in authors :
5456 contrib = (
5557 " (%s)" % author .contribution (page .path (), str )
5658 if page .repo ().config ("show_contribution" ) and len (page .get_authors ()) > 1
5759 else ""
5860 )
59- authors_summary .append (
60- "<a href='mailto:%s'>%s</a>%s" % (author .email (), author .name (), contrib )
61- )
61+ if page .repo ().config ("show_email_address" ):
62+ author_name = "<a href='mailto:%s'>%s</a>" % (author .email (), author .name ())
63+ else :
64+ author_name = author .name ()
65+ authors_summary .append ("%s%s" % (author_name , contrib ))
66+
6267 authors_summary = ", " .join (authors_summary )
6368 return "<span class='git-page-authors git-authors'>%s</span>" % authors_summary
6469
@@ -87,6 +92,7 @@ def site_authors_summary(authors, config: dict):
8792 """
8893 show_contribution = config ["show_contribution" ]
8994 show_line_count = config ["show_line_count" ]
95+ show_email_address = config ["show_email_address" ]
9096
9197 result = """
9298<span class='git-authors'>
@@ -97,11 +103,15 @@ def site_authors_summary(authors, config: dict):
97103 " (%s)" % author .contribution (None , str ) if show_contribution else ""
98104 )
99105 lines = ": %s lines" % author .lines () if show_line_count else ""
106+ author_name = ""
107+ if show_email_address :
108+ author_name = '<a href="mailto:%s">%s</a>' % (author .email (), author .name ())
109+ else :
110+ author_name = author .name ()
100111 result += """
101- <li><a href='mailto:{author_email}'>{ author_name}</a> {lines}{contribution}</li>
112+ <li>{ author_name}{lines}{contribution}</li>
102113 """ .format (
103- author_email = author .email (),
104- author_name = author .name (),
114+ author_name = author_name ,
105115 lines = lines ,
106116 contribution = contribution ,
107117 )
0 commit comments