Skip to content

Commit ec1e43d

Browse files
authored
preconnet to gfonts + navbar fix (#1054)
1 parent d2034ed commit ec1e43d

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

pcweb/components/docpage/navbar/navbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def link_item(name: str, url: str, active_str: str = ""):
6666
active = router_path.contains(active_str)
6767
if active_str == "docs":
6868
active = rx.cond(
69-
router_path.contains("hosting") | router_path.contains("library"),
69+
router_path.contains("library"),
7070
False,
7171
active,
7272
)
@@ -288,7 +288,7 @@ def new_component_section() -> rx.Component:
288288
link_item("Docs", getting_started.introduction.path, "docs"),
289289
),
290290
nav_menu.item(
291-
link_item("Templates", gallery.path, "gallery"),
291+
link_item("Templates", gallery.path, "templates"),
292292
),
293293
nav_menu.item(
294294
new_menu_trigger("Blog", blogs.path, "blog"),

pcweb/pcweb.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,23 @@
2929
radius="large",
3030
accent_color="violet",
3131
),
32-
head_components=get_pixel_website_trackers() + favicons_links(),
32+
head_components=get_pixel_website_trackers()
33+
+ favicons_links()
34+
+ [
35+
rx.el.link(
36+
rel="preconnect",
37+
href="https://fonts.googleapis.com",
38+
),
39+
rx.el.link(
40+
rel="preconnect",
41+
href="https://fonts.gstatic.com",
42+
crossorigin="",
43+
),
44+
rx.el.link(
45+
href="https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=IBM+Plex+Mono:ital,wght@0,500;0,600;1,600&family=Source+Code+Pro:wght@400;500&display=swap&family=JetBrains+Mono:wght@400;500;600;700&display=swap",
46+
rel="stylesheet",
47+
),
48+
],
3349
)
3450

3551

pcweb/styles/styles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def get_code_style_rdx(color: str):
7777

7878
# Fonts to include.
7979
STYLESHEETS = [
80-
"https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=IBM+Plex+Mono:ital,wght@0,500;0,600;1,600&family=Source+Code+Pro:wght@400;500&display=swap&family=JetBrains+Mono:wght@400;500;600;700&display=swap",
8180
"custom-colors.css",
8281
"tailwind-theme.css",
8382
]

0 commit comments

Comments
 (0)