Skip to content

Commit a101c82

Browse files
committed
remove demo for llama index
1 parent 4c1c3a9 commit a101c82

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

pcweb/pages/gallery/apps.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def get_route(path: str):
3131

3232

3333
def more_posts(current_post: dict) -> rx.Component:
34-
3534
posts = []
3635
app_items = list(gallery_apps_data_copy.items())
3736
current_index = next(
@@ -49,8 +48,8 @@ def more_posts(current_post: dict) -> rx.Component:
4948
selected_posts = app_items[-3:]
5049
else:
5150
# Create a list of all posts except the current one
52-
other_posts = app_items[:current_index] + app_items[current_index + 1:]
53-
51+
other_posts = app_items[:current_index] + app_items[current_index + 1 :]
52+
5453
if len(other_posts) <= 3:
5554
# If there are 3 or fewer other posts, show all of them
5655
selected_posts = other_posts
@@ -63,9 +62,9 @@ def more_posts(current_post: dict) -> rx.Component:
6362
else:
6463
# For all other cases, show one before and two after (or two before and one after if we're near the end)
6564
if current_index < len(app_items) - 2:
66-
selected_posts = other_posts[current_index-1:current_index+2]
65+
selected_posts = other_posts[current_index - 1 : current_index + 2]
6766
else:
68-
selected_posts = other_posts[current_index-2:current_index+1]
67+
selected_posts = other_posts[current_index - 2 : current_index + 1]
6968

7069
for path, document in selected_posts:
7170
meta = document.metadata
@@ -131,14 +130,20 @@ def page(document) -> rx.Component:
131130
class_name="flex flex-col gap-3 p-8",
132131
),
133132
rx.box(
134-
rx.link(
135-
button_with_icon(
136-
"View Demo",
137-
icon="new_tab",
138-
class_name="!w-full flex-row-reverse gap-2",
139-
),
140-
is_external=True,
141-
href=meta["demo"],
133+
*(
134+
[
135+
rx.link(
136+
button_with_icon(
137+
"View Demo",
138+
icon="new_tab",
139+
class_name="!w-full flex-row-reverse gap-2",
140+
),
141+
is_external=True,
142+
href=meta["demo"],
143+
)
144+
]
145+
if meta.get("demo")
146+
else []
142147
),
143148
rx.link(
144149
button("View Code", variant="muted", class_name="!w-full"),
@@ -197,4 +202,4 @@ def page(document) -> rx.Component:
197202
)(lambda doc=document: page(doc))
198203

199204
# Add the route to the list of routes.
200-
gallery_apps_routes.append(comp)
205+
gallery_apps_routes.append(comp)

templates/llamaindex-app.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: reflex-llamaindex-template
33
description: "A minimal chat app using LLamaIndex"
44
author: "Reflex"
55
image: "llamaindex.png"
6-
demo: "https://frontend-gold-orca.dev.reflexcorp.run/"
76
source: "https://github.com/reflex-dev/reflex-llamaindex-template"
87
meta: [
98
{"name": "keywords", "content": ""},

0 commit comments

Comments
 (0)