feat(seo): add robots.txt, sitemap, and noindex tags for downloads
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 2m2s

Register routes for robots.txt and sitemap.xml, and implement search engine indexing controls to protect user privacy.

Specifically:
- Set `X-Robots-Tag: noindex, nofollow, noarchive` headers on file downloads, thumbnails, and zip generation.
- Configure `Robots: web.RobotsNone` on download and preview pages to prevent indexing of temporary user uploads.
- Add canonical URLs, improved descriptions, and image alt tags to page metadata for better social sharing.
This commit is contained in:
2026-06-03 12:15:49 +03:00
parent f698ba516d
commit e17c5e92a7
16 changed files with 201 additions and 26 deletions

View File

@@ -7,6 +7,9 @@ import (
"time"
)
// RobotsNone is used for private, protected, expired, or temporary pages.
const RobotsNone = "noindex,nofollow,noarchive"
type Renderer struct {
templates map[string]*template.Template
appName string
@@ -15,16 +18,19 @@ type Renderer struct {
}
type PageData struct {
AppName string
AppVersion string
BaseURL string
Title string
Description string
ImageURL string
CurrentYear int
CurrentUser any
CSRFToken string
Data any
AppName string
AppVersion string
BaseURL string
CanonicalURL string
Robots string
Title string
Description string
ImageURL string
ImageAlt string
CurrentYear int
CurrentUser any
CSRFToken string
Data any
}
func NewRenderer(templateDir, appName, appVersion, baseURL string) (*Renderer, error) {