Skip to content

Commit

Permalink
fileserver: Set canonical URL on browse template (#5867)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Forza-tng committed Oct 11, 2023
1 parent 289934f commit 130f6d1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/caddyhttp/fileserver/browse.html
Expand Up @@ -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">
Expand Down

0 comments on commit 130f6d1

Please sign in to comment.