diff --git a/assets/discussion-icon.svg b/assets/discussion-icon.svg new file mode 100644 index 0000000..62bdd3a --- /dev/null +++ b/assets/discussion-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/references.bib b/references.bib index 0f1a690..1895a38 100644 --- a/references.bib +++ b/references.bib @@ -25,6 +25,7 @@ @inproceedings{Bocovich2024a publisher = {USENIX}, year = {2024}, url = {https://www.usenix.org/system/files/sec24fall-prepub-1998-bocovich.pdf}, + discussion_url = {https://github.com/net4people/bbs/issues/366}, } @inproceedings{Moon2024a, @@ -90,6 +91,7 @@ @inproceedings{Sakamoto2024a publisher = {}, year = {2024}, url = {https://www.petsymposium.org/foci/2024/foci-2024-0002.pdf}, + discussion_url = {https://github.com/net4people/bbs/issues/367}, } @inproceedings{Chi2024a, diff --git a/src/html.go b/src/html.go index 623d484..7353de5 100644 --- a/src/html.go +++ b/src/html.go @@ -68,8 +68,24 @@ func makeBibEntryTitle(entry *bibEntry) string { ``, } // Icons are on the right side. - icons := []string{ - ``, + icons := makeIcons(entry) + return strings.Join(append(title, icons...), "\n") +} + +func makeIcons(entry *bibEntry) []string { + var icons = []string{``} + + // Not all references have a corresponding discussion (e.g., on net4people) + // but if they do, add an icon. + if field, ok := entry.Fields["discussion_url"]; ok { + s := fmt.Sprintf("", field.String()) + + `Discussion icon` + + `` + icons = append(icons, s) + } + + // Add icons that are always present. + icons = append(icons, []string{ fmt.Sprintf("", entry.Fields["url"].String()), `Download icon`, ``, @@ -82,9 +98,9 @@ func makeBibEntryTitle(entry *bibEntry) string { fmt.Sprintf("", entry.CiteName), `Paper link icon`, ``, - ``, - } - return strings.Join(append(title, icons...), "\n") + }...) + + return append(icons, ``) } func makeBibEntryAuthors(entry *bibEntry) string {