diff options
author | dakkar <dakkar@thenautilus.net> | 2022-01-22 13:09:22 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2022-01-22 13:09:22 +0000 |
commit | 3e28d13e06c1e9d80fcaaf2507d10976a3870e75 (patch) | |
tree | f26704d1931c53c6364a69a04ea076e742f84267 | |
parent | search in files (diff) | |
download | media-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.tar.gz media-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.tar.bz2 media-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.zip |
probably templated webmanifest
-rw-r--r-- | META6.json | 1 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | lib/App/MediaControl/Web.rakumod | 4 | ||||
-rw-r--r-- | resources/ir.webmanifest | 8 |
4 files changed, 10 insertions, 5 deletions
@@ -9,6 +9,7 @@ "Cro::HTTP::Router", "Cro::HTTP::Server", "Cro::Uri::HTTP", + "Cro::WebApp::Template", "DB::SQLite", "NativeCall", "XML" @@ -1,5 +1,7 @@ very WIP… + mkdir local + zef install \ --deps-only \ --contained \ diff --git a/lib/App/MediaControl/Web.rakumod b/lib/App/MediaControl/Web.rakumod index 621c5f8..ed78e77 100644 --- a/lib/App/MediaControl/Web.rakumod +++ b/lib/App/MediaControl/Web.rakumod @@ -1,6 +1,7 @@ use v6.d; use Cro::HTTP::Server; use Cro::HTTP::Router; +use Cro::WebApp::Template; use Vlc::Client; use Lirc::Commands; use App::MediaControl::DB; @@ -54,10 +55,11 @@ class App::MediaControl::Web { my $application = route { resources-from %?RESOURCES; + templates-from-resources; get -> { resource 'index.html' } get -> 'ir.png' { resource 'ir.png' } - get -> 'ir.webmanifest' { resource 'ir.webmanifest' } + get -> 'ir.webmanifest' { template 'ir.webmanifest', request } include :$vlc, :$ir, :$media; diff --git a/resources/ir.webmanifest b/resources/ir.webmanifest index 55c8fd7..ab5f6e8 100644 --- a/resources/ir.webmanifest +++ b/resources/ir.webmanifest @@ -1,6 +1,6 @@ { "background_color": "white", - "description": "Living room infrared control", + "description": "Living room media control", "display": "standalone", "icons": [ { @@ -9,7 +9,7 @@ "type": "image/png" } ], - "name": "Infrared control", - "short_name": "IR", - "start_url": "/mc/" + "name": "Media Control", + "short_name": "MC", + "start_url": "<.uri.add('..').path>" } |