Fork pd_web, remove everything we don't need
This commit is contained in:
@@ -87,43 +87,6 @@ func getRequestAddress(r *http.Request) (addr string) {
|
||||
return "https://" + r.Host
|
||||
}
|
||||
}
|
||||
|
||||
func (wc *WebController) metadataFromFile(r *http.Request, f pixelapi.FileInfo) ogData {
|
||||
var addr = getRequestAddress(r)
|
||||
return generateOGData(
|
||||
f.Name,
|
||||
f.MimeType,
|
||||
addr+"/u/"+f.ID,
|
||||
addr+"/api/file/"+f.ID,
|
||||
addr+"/api/file/"+f.ID+"/thumbnail",
|
||||
defaultThemeColour,
|
||||
)
|
||||
}
|
||||
func (wc *WebController) metadataFromList(r *http.Request, l pixelapi.ListInfo) ogData {
|
||||
var addr = getRequestAddress(r)
|
||||
if l.FileCount > 0 {
|
||||
return generateOGData(
|
||||
l.Title,
|
||||
l.Files[0].MimeType,
|
||||
addr+"/l/"+l.ID,
|
||||
addr+"/api/file/"+l.Files[0].ID,
|
||||
addr+"/api/file/"+l.Files[0].ID+"/thumbnail",
|
||||
defaultThemeColour,
|
||||
)
|
||||
}
|
||||
|
||||
var og = ogData{}
|
||||
og.addProp("og:type", "website")
|
||||
og.addProp("og:title", l.Title)
|
||||
og.addProp("og:site_name", "pixeldrain")
|
||||
og.addProp("og:description", "A collection of files on pixeldrain")
|
||||
og.addProp("description", "A collection of files on pixeldrain")
|
||||
og.addName("description", "A collection of files on pixeldrain")
|
||||
og.addProp("og:url", addr+"/l/"+l.ID)
|
||||
og.addName("twitter:title", l.Title)
|
||||
return og
|
||||
}
|
||||
|
||||
func (wc *WebController) metadataFromFilesystem(r *http.Request, f pixelapi.FilesystemPath) (og ogData) {
|
||||
var addr = getRequestAddress(r)
|
||||
var base = &f.Path[f.BaseIndex]
|
||||
|
Reference in New Issue
Block a user