@@ -68,8 +68,24 @@ func makeBibEntryTitle(entry *bibEntry) string {
68
68
`</span>` ,
69
69
}
70
70
// Icons are on the right side.
71
- icons := []string {
72
- `<span class="icons">` ,
71
+ icons := makeIcons (entry )
72
+ return strings .Join (append (title , icons ... ), "\n " )
73
+ }
74
+
75
+ func makeIcons (entry * bibEntry ) []string {
76
+ var icons = []string {`<span class="icons">` }
77
+
78
+ // Not all references have a corresponding discussion (e.g., on net4people)
79
+ // but if they do, add an icon.
80
+ if field , ok := entry .Fields ["discussion_url" ]; ok {
81
+ s := fmt .Sprintf ("<a href='%s'>" , field .String ()) +
82
+ `<img class="icon" title="Online discussion" src="assets/discussion-icon.svg" alt="Discussion icon">` +
83
+ `</a>`
84
+ icons = append (icons , s )
85
+ }
86
+
87
+ // Add icons that are always present.
88
+ icons = append (icons , []string {
73
89
fmt .Sprintf ("<a href='%s'>" , entry .Fields ["url" ].String ()),
74
90
`<img class="icon" title="Download paper" src="assets/pdf-icon.svg" alt="Download icon">` ,
75
91
`</a>` ,
@@ -82,9 +98,9 @@ func makeBibEntryTitle(entry *bibEntry) string {
82
98
fmt .Sprintf ("<a href='#%s'>" , entry .CiteName ),
83
99
`<img class="icon" title="Link to paper" src="assets/link-icon.svg" alt="Paper link icon">` ,
84
100
`</a>` ,
85
- `</span>` ,
86
- }
87
- return strings . Join ( append (title , icons ... ), " \n " )
101
+ } ... )
102
+
103
+ return append (icons , `</span>` )
88
104
}
89
105
90
106
func makeBibEntryAuthors (entry * bibEntry ) string {
0 commit comments