Support embedding profiles in external web pages

prifile design SQUASH
This commit is contained in:
Daniele Tonon
2023-11-28 19:50:17 +01:00
parent 4db1a1e38d
commit 35d053fc87
5 changed files with 185 additions and 7 deletions

View File

@@ -59,13 +59,6 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
return
}
// render npub and nprofile using a separate function
if prefix == "npub" || prefix == "nprofile" {
// it's a profile
renderProfile(w, r, code)
return
}
// Check if the embed parameter is set to "yes"
embedParam := r.URL.Query().Get("embed")
if embedParam == "yes" {
@@ -73,6 +66,13 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
return
}
// render npub and nprofile using a separate function
if prefix == "npub" || prefix == "nprofile" {
// it's a profile
renderProfile(w, r, code)
return
}
// get data for this event
data, err := grabData(r.Context(), code, false)
if err != nil {