diff --git a/src/wolf/app/render/html.py b/src/wolf/app/render/html.py
index e9d84fb..ffbbfaf 100644
--- a/src/wolf/app/render/html.py
+++ b/src/wolf/app/render/html.py
@@ -1,15 +1,44 @@
import wrapt
import structlog
+from pathlib import PurePosixPath
from typing import Sequence
from functools import partial
from wolf.rendering.ui import UI
-from wolf.rendering.resources import Resource, NeededResources
from wolf.app.response import Response, FileWrapperResponse
+from html_resources.resources import Resource
+from html_resources.needed import NeededResources
logger = structlog.get_logger("wolf.app.render")
+class BoundResources(NeededResources):
+
+ def __init__(self, path: str | PurePosixPath, *args, **kwargs):
+ self.path = PurePosixPath(path)
+ super().__init__(*args, **kwargs)
+
+ def apply(self, body: str | bytes, base_uri: str = "") -> bytes:
+ if len(self.data) == 0:
+ return body
+
+ if isinstance(body, str):
+ body = body.encode()
+
+ top = b""
+ bottom = b""
+ for resource in self.unfold():
+ if resource.bottom:
+ bottom += resource.render(base_uri / self.path)
+ else:
+ top += resource.render(base_uri / self.path)
+ if top:
+ body = body.replace(b"", top + b"", 1)
+ if bottom:
+ body = body.replace(b"