Disallow indexing of all file pages

This commit is contained in:
2024-08-27 01:29:09 +02:00
parent 062b0df7f1
commit 8887a043c8
4 changed files with 12 additions and 0 deletions

View File

@@ -5,6 +5,8 @@
<title>{{.Title}}</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="robots" content="noindex, nofollow">
{{ template "opengraph" .OGData }}
<link id="stylesheet_layout" rel="stylesheet" type="text/css" href="/res/style/layout.css?v{{cacheID}}"/>

View File

@@ -5,6 +5,7 @@
<title>{{.Title}}</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="robots" content="noindex, nofollow">
<link id="stylesheet_layout" rel="stylesheet" type="text/css" href="/res/style/layout.css?v{{cacheID}}"/>
<link id="stylesheet_theme" rel="stylesheet" type="text/css" href="/theme.css"/>

View File

@@ -60,6 +60,9 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
return
}
// Prevent search engines from indexing this page for privacy reasons
w.Header().Set("X-Robots-Tag", "noindex, nofollow")
var err error
var ids = strings.Split(p.ByName("id"), ",")
var templateData = wc.newTemplateData(w, r)
@@ -142,6 +145,9 @@ func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request,
return
}
// Prevent search engines from indexing this page for privacy reasons
w.Header().Set("X-Robots-Tag", "noindex, nofollow")
var templateData = wc.newTemplateData(w, r)
var list, err = templateData.PixelAPI.GetListID(p.ByName("id"))
if err != nil {

View File

@@ -17,6 +17,9 @@ func (wc *WebController) serveDirectory(w http.ResponseWriter, r *http.Request,
var td = wc.newTemplateData(w, r)
var path = strings.TrimPrefix(p.ByName("path"), "/")
// Prevent search engines from indexing this page for privacy reasons
w.Header().Set("X-Robots-Tag", "noindex, nofollow")
if path == "" {
wc.templates.Get().ExecuteTemplate(w, "404", td)
return