diff options
author | Forza <68693597+Forza-tng@users.noreply.github.com> | 2023-10-11 21:47:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 13:47:38 -0600 |
commit | 130f6d1f838900c12e1649e580aae817e8c2909e (patch) | |
tree | 57c76685521059303209326c5a5d232636737bea | |
parent | 289934f3d16405c6aa791d2b0702c2f893045e0e (diff) |
fileserver: Set canonical URL on browse template (#5867)
* Browse.html: Add canonical URL and home-link
When contents are equal, but maybe just a sort order is different, it is good to add `<link rel="canonical" href="base-path/" />`. This helps search engines propeely index the page.
I also added a link to the home page with the name of `{{.Host}}` just above the bread crumbs to make the page clearer.
https://paste.tnonline.net/files/28Wun5CQZiqA_Screenshot_20231007_134435_Opera.png
* Update browse.html
-rw-r--r-- | modules/caddyhttp/fileserver/browse.html | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/browse.html b/modules/caddyhttp/fileserver/browse.html index 88036d0..1c8be7f 100644 --- a/modules/caddyhttp/fileserver/browse.html +++ b/modules/caddyhttp/fileserver/browse.html @@ -299,6 +299,7 @@ <html> <head> <title>{{html .Name}}</title> + <link rel="canonical" href="{{.Path}}/" /> <meta charset="utf-8"> <meta name="color-scheme" content="light dark"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> |