diff --git a/app/main.py b/app/main.py index 91762fd..35c9f33 100644 --- a/app/main.py +++ b/app/main.py @@ -7,6 +7,7 @@ from app.services.markdown_processor import MarkdownProcessor from app.services.metadata_processor import MetadataProcessor from app.controllers.dynamic_controller import DynamicController from app.controllers.category_controller import CategoryController +from fastapi.middleware.gzip import GZipMiddleware class Application: @@ -15,6 +16,7 @@ class Application: self.app = FastAPI(lifespan=self._lifespan_event) self._setup_static_files() self._include_routers() + self._include_middelware() @asynccontextmanager async def _lifespan_event(self, app: FastAPI): @@ -49,6 +51,8 @@ class Application: self.app.include_router(route_to_web.router) + def _include_middelware(self): + self.app.add_middleware( GZipMiddleware, minimum_size = 500 ) def get_app(self): """Return the FastAPI app instance.""" diff --git a/app/services/markdown_render.py b/app/services/markdown_render.py index 8d08c0c..947c562 100644 --- a/app/services/markdown_render.py +++ b/app/services/markdown_render.py @@ -6,7 +6,7 @@ def img_left_overlay(src): """Render an image with overlay.""" return f'''
''' @@ -59,13 +59,13 @@ def slider(options, images): if int(len(images))<=int(i+1): modal_id_next = f"{modal_id}_0" if i % 2 == 0: - html_content.append(f"""""".strip()) + html_content.append(f"""""".strip()) else: - html_content.append(f"""""".strip()) + html_content.append(f"""""".strip()) html_content.append(f"""