From 3e28d13e06c1e9d80fcaaf2507d10976a3870e75 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 22 Jan 2022 13:09:22 +0000 Subject: probably templated webmanifest --- META6.json | 1 + README.md | 2 ++ lib/App/MediaControl/Web.rakumod | 4 +++- resources/ir.webmanifest | 8 ++++---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/META6.json b/META6.json index e22af51..8115e7e 100644 --- a/META6.json +++ b/META6.json @@ -9,6 +9,7 @@ "Cro::HTTP::Router", "Cro::HTTP::Server", "Cro::Uri::HTTP", + "Cro::WebApp::Template", "DB::SQLite", "NativeCall", "XML" diff --git a/README.md b/README.md index ff91f6c..f58d9b7 100644 --- a/README.md +++ b/README.md @@ -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>" } -- cgit v1.2.3