Added initial support for OpenGraph meta-tags
This commit is contained in:
parent
c1e6d5869a
commit
9b91cde088
@ -28,6 +28,13 @@
|
|||||||
<meta name="msapplication-TileImage" content="[{[ .StaticURL ]}]/img/icons/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="[{[ .StaticURL ]}]/img/icons/mstile-144x144.png">
|
||||||
<meta name="msapplication-TileColor" content="[{[ if .Color -]}][{[ .Color ]}][{[ else ]}]#2979ff[{[ end ]}]">
|
<meta name="msapplication-TileColor" content="[{[ if .Color -]}][{[ .Color ]}][{[ else ]}]#2979ff[{[ end ]}]">
|
||||||
|
|
||||||
|
<!-- Meta-information for OpenGraph embedding -->
|
||||||
|
<meta property="og:url" content="[{[ .BaseURL ]}][{[ .Path ]}]">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="[{[ if .Name -]}][{[ .Name ]}][{[ else ]}]File Browser[{[ end ]}]">
|
||||||
|
<meta property="og:description" content="[{[ .Path ]}]">
|
||||||
|
<meta property="og:image" content="[{[ .StaticURL ]}]/img/icons/android-chrome-512x512.png">
|
||||||
|
|
||||||
<!-- Inject Some Variables and generate the manifest json -->
|
<!-- Inject Some Variables and generate the manifest json -->
|
||||||
<script>
|
<script>
|
||||||
window.FileBrowser = JSON.parse('[{[ .Json ]}]');
|
window.FileBrowser = JSON.parse('[{[ .Json ]}]');
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/filebrowser/filebrowser/v2/version"
|
"github.com/filebrowser/filebrowser/v2/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys fs.FS, file, contentType string) (int, error) {
|
func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *data, fSys fs.FS, file, contentType string) (int, error) {
|
||||||
w.Header().Set("Content-Type", contentType)
|
w.Header().Set("Content-Type", contentType)
|
||||||
|
|
||||||
auther, err := d.store.Auth.Get(d.settings.AuthMethod)
|
auther, err := d.store.Auth.Get(d.settings.AuthMethod)
|
||||||
@ -43,6 +43,8 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
|
|||||||
"EnableThumbs": d.server.EnableThumbnails,
|
"EnableThumbs": d.server.EnableThumbnails,
|
||||||
"ResizePreview": d.server.ResizePreview,
|
"ResizePreview": d.server.ResizePreview,
|
||||||
"EnableExec": d.server.EnableExec,
|
"EnableExec": d.server.EnableExec,
|
||||||
|
"Origin": r.URL.Scheme + r.Host,
|
||||||
|
"Path": r.URL.Path,
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.settings.Branding.Files != "" {
|
if d.settings.Branding.Files != "" {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user