mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
parent
8f9ccc6540
commit
2c2700a31d
20 changed files with 534 additions and 200 deletions
|
@ -61,17 +61,25 @@ func (f *funcMap) Map() template.FuncMap {
|
|||
return template.HTML(str)
|
||||
},
|
||||
"proxyFilter": func(data string) string {
|
||||
return proxy.ImageProxyRewriter(f.router, data)
|
||||
return proxy.ProxyRewriter(f.router, data)
|
||||
},
|
||||
"proxyURL": func(link string) string {
|
||||
proxyImages := config.Opts.ProxyImages()
|
||||
proxyOption := config.Opts.ProxyOption()
|
||||
|
||||
if proxyImages == "all" || (proxyImages != "none" && !url.IsHTTPS(link)) {
|
||||
if proxyOption == "all" || (proxyOption != "none" && !url.IsHTTPS(link)) {
|
||||
return proxy.ProxifyURL(f.router, link)
|
||||
}
|
||||
|
||||
return link
|
||||
},
|
||||
"mustBeProxyfied": func(mediaType string) bool {
|
||||
for _, t := range config.Opts.ProxyMediaTypes() {
|
||||
if t == mediaType {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
},
|
||||
"domain": func(websiteURL string) string {
|
||||
return url.Domain(websiteURL)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue