mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
Add manifest.json for better mobile integration
manifest.json allows yarr to run in a more app-like mode on mobile devices. More info here: https://developer.mozilla.org/en-US/docs/Web/Manifest
This commit is contained in:
parent
ce07ddea92
commit
e4c1d01915
@ -7,6 +7,7 @@
|
|||||||
<link rel="stylesheet" href="./static/stylesheets/app.css">
|
<link rel="stylesheet" href="./static/stylesheets/app.css">
|
||||||
<link rel="icon" href="./static/graphicarts/favicon.svg" type="image/svg+xml">
|
<link rel="icon" href="./static/graphicarts/favicon.svg" type="image/svg+xml">
|
||||||
<link rel="alternate icon" href="./static/graphicarts/favicon.png" type="image/png">
|
<link rel="alternate icon" href="./static/graphicarts/favicon.png" type="image/png">
|
||||||
|
<link rel="manifest" href="./manifest.json" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<script>
|
<script>
|
||||||
window.app = window.app || {}
|
window.app = window.app || {}
|
||||||
|
@ -39,6 +39,7 @@ func (s *Server) handler() http.Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.For("/", s.handleIndex)
|
r.For("/", s.handleIndex)
|
||||||
|
r.For("/manifest.json", s.handleManifest)
|
||||||
r.For("/static/*path", s.handleStatic)
|
r.For("/static/*path", s.handleStatic)
|
||||||
r.For("/api/status", s.handleStatus)
|
r.For("/api/status", s.handleStatus)
|
||||||
r.For("/api/folders", s.handleFolderList)
|
r.For("/api/folders", s.handleFolderList)
|
||||||
@ -76,6 +77,24 @@ func (s *Server) handleStatic(c *router.Context) {
|
|||||||
http.StripPrefix(s.BasePath+"/static/", http.FileServer(http.FS(assets.FS))).ServeHTTP(c.Out, c.Req)
|
http.StripPrefix(s.BasePath+"/static/", http.FileServer(http.FS(assets.FS))).ServeHTTP(c.Out, c.Req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) handleManifest(c *router.Context) {
|
||||||
|
c.JSON(http.StatusOK, map[string]interface{}{
|
||||||
|
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
|
||||||
|
"name": "yarr!",
|
||||||
|
"short_name": "yarr",
|
||||||
|
"description": "yet another rss reader",
|
||||||
|
"display": "standalone",
|
||||||
|
"start_url": s.BasePath,
|
||||||
|
"icons": []map[string]interface{}{
|
||||||
|
{
|
||||||
|
"src": s.BasePath + "/static/graphicarts/favicon.png",
|
||||||
|
"sizes": "64x64",
|
||||||
|
"type": "image/png",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) handleStatus(c *router.Context) {
|
func (s *Server) handleStatus(c *router.Context) {
|
||||||
c.JSON(http.StatusOK, map[string]interface{}{
|
c.JSON(http.StatusOK, map[string]interface{}{
|
||||||
"running": s.worker.FeedsPending(),
|
"running": s.worker.FeedsPending(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user