answer about autofiles for tags
[ikiwiki] / doc / todo / avatar.mdwn
1 [[!tag wishlist]]
2
3 It would be nice if ikiwiki, particularly [[plugins/comments]]
4 (but also, ideally, recentchanges) supported user avatar icons.
5
6 Idea is to add a directive that displays a small avatar image for a user.
7 Pass it a user's the email address, openid, username, or the md5 hash
8 of their email address:
9
10         \[[!avatar user@example.com]]
11         \[[!avatar http://joey.kitenet.net/]]
12         \[[!avatar user]]
13         \[[!avatar hash]]
14
15 These directives can then be hand-inserted onto pages, or more likely,
16 included in eg, a comment post via a template.
17
18 An optional second parameter can be included, containing additional
19 options to pass in the 
20 [gravatar url](http://en.gravatar.com/site/implement/url).
21 For example, this asks for a smaller gravatar, and if a user does
22 not have a gravatar, uses a cute auto-generated "wavatar" avatar.
23
24         \[[!gravatar user@example.com "size=40&default=wavatar"]]
25
26 The `gravitar_options` setting in the setup file can be used to
27 specify additional options to pass. So for example if you want
28 to use wavatars everywhere, set it to "default=wavatar".
29
30 The avatars are provided by various sites. For email addresses, it uses a
31 [gravatar](http://gravatar.com/). For a wiki username, the
32 user's email address is looked up and the gravatar for that user is
33 displayed. (Of course, the user has to have filled in their email address
34 on their Preferences page for that to work. Also, when the user changes
35 their email address in Preferences, the gravatar won't change until the
36 wiki is rebuilt.)
37
38 For openid, openavatar sucked and is now dead. So we need to use an email
39 address instead, I guess. Problem is that the email address of a given
40 openid is only known when that user is logged in and making a change.
41 And we don't want to leak an openid user's email into a page either.
42 Hmm. Suppose the gravatar hash could be calculated from the email address
43 and embedded instead of the openid? That would work for comments,
44 but not if the directive were used elsewhere.
45
46 Or, for openid, could use <http://paulisageek.com/openidavatar>. Which
47 works fine, but users are not likely to figure out what they need to do to
48 get an avatar associated with their openid.
49
50 ---
51
52 Alternative, not overdesigned approach:
53
54 Modify comments plugin to have an option to display avatars.
55
56 When posting a comment, fill in the avatarhash field in the template.
57 The hash is calculated from the user's email address. If the user's email
58 is not known, skip it. 
59
60 End. :P