GoAT Site is library that implements Standard.site in Go.
atprotocol standard-site atproto library
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(verif): get html tag for document

+15 -1
+9
document.go
··· 3 3 import ( 4 4 "context" 5 5 "encoding/json" 6 + "fmt" 7 + "html/template" 6 8 "strings" 7 9 "time" 8 10 ··· 134 136 func DeleteDocument(ctx context.Context, client lexutil.LexClient, repo syntax.AtIdentifier, rkey syntax.RecordKey) error { 135 137 return deleteRecord(ctx, client, CollectionDocument, repo, rkey) 136 138 } 139 + 140 + // GetDocumentVerificationTag returns the HTML link tag checked during the verification of the [Document]. 141 + func GetDocumentVerificationTag(repo syntax.AtIdentifier, rkey syntax.RecordKey) template.HTML { 142 + return template.HTML( 143 + fmt.Sprintf(`<link rel="%s" href="%s">`, CollectionDocument, createAtURI(repo, CollectionDocument, rkey)), 144 + ) 145 + }
+5
lexicons.go
··· 264 264 }) 265 265 return err 266 266 } 267 + 268 + // createAtURI returns a valid [syntax.ATURI]. 269 + func createAtURI(repo syntax.AtIdentifier, collection string, rkey syntax.RecordKey) string { 270 + return fmt.Sprintf("at://%s/%s/%s", repo, collection, rkey) 271 + }
+1 -1
publication.go
··· 94 94 // See [GetPublicationVerificationURI]. 95 95 func HandlePublicationVerification(repo syntax.AtIdentifier, rkey syntax.RecordKey) http.Handler { 96 96 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 97 - fmt.Fprintf(w, "at://%s/%s/%s", repo, CollectionPublication, rkey) 97 + fmt.Fprint(w, createAtURI(repo, CollectionPublication, rkey)) 98 98 }) 99 99 } 100 100