aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2022-01-22 13:09:22 +0000
committerdakkar <dakkar@thenautilus.net>2022-01-22 13:09:22 +0000
commit3e28d13e06c1e9d80fcaaf2507d10976a3870e75 (patch)
treef26704d1931c53c6364a69a04ea076e742f84267
parentsearch in files (diff)
downloadmedia-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.tar.gz
media-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.tar.bz2
media-control-3e28d13e06c1e9d80fcaaf2507d10976a3870e75.zip
probably templated webmanifest
-rw-r--r--META6.json1
-rw-r--r--README.md2
-rw-r--r--lib/App/MediaControl/Web.rakumod4
-rw-r--r--resources/ir.webmanifest8
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>"
}