Quellcode durchsuchen

fix link to nginx example

Falko Schindler vor 2 Jahren
Ursprung
Commit
8ef79c5386
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 1 1
      main.py
  2. 2 2
      website/style.py

+ 1 - 1
main.py

@@ -217,7 +217,7 @@ ui.run()
             example_link('OpenCV Webcam', 'uses OpenCV to capture images from a webcam')
             example_link('SVG Clock', 'displays an analog clock by updating an SVG with `ui.timer`')
             example_link('Progress', 'demonstrates a progress bar for heavy computations')
-            example_link('NGINX Subpath', 'shows the setup to serve an app behind a reverse proxy subpath')
+            example_link('NGINX Subpath', 'shows the setup to serve an app behind a reverse proxy subpath', filename='')
 
     with ui.row().classes('bg-primary w-full min-h-screen mt-16'):
         link_target('why')

+ 2 - 2
website/style.py

@@ -26,9 +26,9 @@ def subtitle(content: str) -> ui.markdown:
     return ui.markdown(content).classes('text-xl sm:text-2xl md:text-3xl leading-7')
 
 
-def example_link(title: str, description: str) -> None:
+def example_link(title: str, description: str, *, filename: str = 'main.py') -> None:
     name = title.lower().replace(' ', '_')
-    with ui.link(target=f'https://github.com/zauberzeug/nicegui/tree/main/examples/{name}/main.py') \
+    with ui.link(target=f'https://github.com/zauberzeug/nicegui/tree/main/examples/{name}/{filename}') \
             .classes('bg-[#5898d420] p-4 self-stretch rounded flex flex-col gap-2') \
             .style('box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1)'):
         ui.label(title).classes(replace='text-black font-bold')