@@ -189,10 +189,11 @@ func firstParagraph(s string) string { // CommitID is a component that displays a commit ID. E.g., "c0de1234". type CommitID struct { SHA string HTMLURL string // Optional. OnClick string // Optional. } func (c CommitID) Render() []*html.Node { sha := &html.Node{ Type: html.ElementNode, Data: atom.Code.String(), @@ -208,10 +209,13 @@ func (c CommitID) Render() []*html.Node { Attr: []html.Attribute{ {Key: atom.Href.String(), Val: c.HTMLURL}, }, FirstChild: sha, } if c.OnClick != "" { sha.Attr = append(sha.Attr, html.Attribute{Key: atom.Onclick.String(), Val: c.OnClick}) } } return []*html.Node{sha} } // Reference is a component that displays a reference (branch or tag). E.g., "main".