File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -907,15 +907,22 @@ def index_string(self, value: str) -> None:
907907 self ._index_string = value
908908
909909 @with_app_context
910- def serve_layout (self ):
911- layout = self . _layout_value ()
910+ def get_layout (self ):
911+ """Return the resolved layout with all hooks applied.
912912
913+ This is the canonical way to obtain the app's layout — it
914+ calls the layout function (if callable), includes extra
915+ components, and runs layout hooks.
916+ """
917+ layout = self ._layout_value ()
913918 for hook in self ._hooks .get_hooks ("layout" ):
914919 layout = hook (layout )
920+ return layout
915921
922+ def serve_layout (self ):
916923 # TODO - Set browser cache limit - pass hash into frontend
917924 return flask .Response (
918- to_json (layout ),
925+ to_json (self . get_layout () ),
919926 mimetype = "application/json" ,
920927 )
921928
You can’t perform that action at this time.
0 commit comments