use maud::{Markup, html};
use crate::{
capability::define_register_items,
components::{HeadSlotTag, RenderSlot, SlotCapability, SlotCtx, SlotOf, SlotRegistrar},
http::ProvideRequestCaps,
template::{TemplateCapability, TemplateRegistrar},
};
#[derive(Default)]
pub struct PwaManifestLink;
impl RenderSlot for PwaManifestLink {
fn render_slot(&self, _ctx: &SlotCtx) -> Markup {
html! {
link rel="manifest" href="/app.webmanifest";
}
}
}
define_register_items! {
plugin: PwaTag;
capability: TemplateCapability;
trait: TemplateRegistrar;
method: register_templates;
bounds: [Clone, ProvideRequestCaps, Send, Sync];
items: [];
hook: Hook;
}
define_register_items! {
plugin: PwaTag;
capability: SlotCapability;
trait: SlotRegistrar;
method: register_slots;
wrapper: SlotOf;
bounds: [];
hook: SlotsHook;
items: [
ManifestIdx: PwaManifestLinkTag, HeadSlotTag => PwaManifestLink,
]
}