Skip to content

Commit ad5e14a

Browse files
authored
ENG-8154: update check_dead_links script and fix broken links (#1682)
1 parent fb87b28 commit ad5e14a

File tree

10 files changed

+43
-14
lines changed

10 files changed

+43
-14
lines changed

case-studies/ansa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ rx.vstack(
5151
)
5252
```
5353

54-
Meet [Ansa](www.ansa.co), a venture capital firm based in New York City that invests in companies from Series A to C. They have invested in companies like Defense Unicorns, Bland, Gradient, and Selector and prior to founding the firm, supported investments in many of the venture-capital industry’s largest outcomes including Crowdstrike, Coinbase, and SurveyMonkey to name a few.
54+
Meet [Ansa](https://www.ansa.co), a venture capital firm based in New York City that invests in companies from Series A to C. They have invested in companies like Defense Unicorns, Bland, Gradient, and Selector and prior to founding the firm, supported investments in many of the venture-capital industry’s largest outcomes including Crowdstrike, Coinbase, and SurveyMonkey to name a few.
5555

5656
Ryan Sullivan is an investor and oversees the engineering and data science team at Ansa. He finds and supports new investments and is the architect behind Ansa's data-driven sourcing strategy, working closely with the firms’ Managing Partner Marco Demeireles to build the firms’ proprietary sourcing applications and research products.
5757

case-studies/sellerx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Below are some of the key Reflex features their app took advantage of:
117117

118118
- Reflex's background events for long running scraping tasks to extract all the data that they needed.
119119

120-
- [AG Grid]({library.tables_and_data_grids.ag_grid.path}), which is built into Reflex, to display the data in a table. AG Grid is a high performance data grid that is used in many fortune 500 companies web applications.
120+
- [AG Grid](/docs/enterprise/ag-grid), which is built into Reflex, to display the data in a table. AG Grid is a high performance data grid that is used in many fortune 500 companies web applications.
121121

122122
- SSO was a requirement for the app, and Mike used Azure Auth, one of the many options provided by Reflex for authentication.
123123

docs/custom-components/command-reference.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
```python exec
2+
from pcweb.pages import docs
3+
```
4+
15
# Command Reference
26

37
The custom component commands are under `reflex component` subcommand. To see the list of available commands, run `reflex component --help`. To see the manual on a specific command, run `reflex component <command> --help`, for example, `reflex component init --help`.
@@ -81,11 +85,11 @@ The `custom_components` folder is where the actual implementation is. Do not wor
8185

8286
`reflex_google_auth` is the top folder for importable code. The `reflex_google_auth/__init__.py` imports everything from the `reflex_google_auth/google_auth.py`. For the user of the package, the import looks like `from reflex_google_auth import ABC, XYZ`.
8387

84-
`reflex_google_auth/google_auth.py` is prefilled with code example and instructions from the [wrapping react guide]({wrapping_react.overview.path}).
88+
`reflex_google_auth/google_auth.py` is prefilled with code example and instructions from the [wrapping react guide]({docs.wrapping_react.overview.path}).
8589

8690
### Demo App Folder
8791

88-
A demo app is generated inside `google_auth_demo` folder with import statements and example usage of the component. This is a regular Reflex app. Go into this directory and start using any reflex commands for testing. The user is encouraged to deploy the demo app, so it can later be included as part of the [Gallery]({gallery.path}).
92+
A demo app is generated inside `google_auth_demo` folder with import statements and example usage of the component. This is a regular Reflex app. Go into this directory and start using any reflex commands for testing.
8993

9094
### Help Manual
9195

docs/enterprise/mantine/pill.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def pill_group_page():
5151
By itself it does not include any logic, it only renders given children.
5252

5353
```md alert info
54-
# For a fully functional out-of-the-box component, consider using [`rxe.mantine.tags_input`]({docs.mantine.tags_input.route}) instead.
54+
# For a fully functional out-of-the-box component, consider using [`rxe.mantine.tags_input`](/docs/enterprise/mantine/tags-input/) instead.
5555
```
5656

5757
## Example

docs/getting_started/dashboard_tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ The `radius` prop sets the global radius value for the app that is inherited by
16061606

16071607
The `accent_color` prop sets the accent color of the app. Check out other options for the accent color [here]({docs.library.other.theme.path}).
16081608

1609-
To see other props that can be set at the app level check out this [documentation](docs.styling.theming.path)
1609+
To see other props that can be set at the app level check out this [documentation]({docs.styling.theming.path})
16101610

16111611
```python
16121612
app = rx.App(

docs/library/data-display/callout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A `callout` is a short message to attract user's attention.
3030
rx.callout("You will need admin privileges to install and access this application.", icon="info")
3131
```
3232

33-
The `icon` prop allows an icon to be passed to the `callout` component. See the [**icon** component for all icons that are available.]({docs.library.data_display.icon.path})
33+
The `icon` prop allows an icon to be passed to the `callout` component. See the [**icon** component for all icons that are available.](/docs/library/data-display/icon)
3434

3535
## As alert
3636

docs/library/forms/select.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def select_form_example():
181181

182182
### Using Select within a Drawer component
183183

184-
If using within a [Drawer](../../overlay/drawer/) component, set the `position` prop to `"popper"` to ensure the select menu is displayed correctly.
184+
If using within a [Drawer](/docs/library/overlay/drawer) component, set the `position` prop to `"popper"` to ensure the select menu is displayed correctly.
185185

186186
```python demo
187187
rx.drawer.root(

pcweb/pages/gallery/apps.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pcweb.components.icons import get_icon
1111
from pcweb.constants import SCREENSHOT_BUCKET
1212
from pcweb.flexdown import xd2 as xd
13-
from pcweb.pages.gallery import gallery
13+
from pcweb.pages import docs
1414
from pcweb.templates.gallery_app_page import gallery_app_page
1515

1616
GALLERY_APP_SOURCES = [
@@ -73,7 +73,8 @@ def more_posts(current_post: dict) -> rx.Component:
7373
selected_posts = other_posts[current_index - 2 : current_index + 1]
7474

7575
for _path, document in selected_posts:
76-
posts.append(gallery_app_card(app=document.metadata))
76+
if not _path[0].startswith("reflex_build_templates/"):
77+
posts.append(gallery_app_card(app=document.metadata))
7778

7879
return rx.el.section(
7980
rx.box(
@@ -87,7 +88,7 @@ def more_posts(current_post: dict) -> rx.Component:
8788
class_name="flex items-center gap-1.5 border-slate-5 bg-slate-1 hover:bg-slate-3 shadow-small px-1.5 py-0.5 border rounded-md w-auto max-w-full text-slate-9 transition-bg cursor-pointer overflow-hidden border-solid",
8889
),
8990
underline="none",
90-
href=gallery.path,
91+
href=docs.getting_started.open_source_templates.path,
9192
),
9293
class_name="flex flex-row items-center justify-between gap-4",
9394
),

pcweb/pcweb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787

8888
# Add redirects
8989
redirects = [
90+
("/docs/ui", "/docs/ui/overview"),
91+
("/docs/enterprise/react-flow", "/docs/enterprise/react-flow/overview"),
92+
("/docs/advanced-onboarding", "/docs/advanced-onboarding/code-structure"),
93+
("/docs/hosting/cli", "/docs/hosting"),
9094
("/docs/enterprise/ag-grid/index", "/docs/enterprise/ag-grid"),
9195
("/docs/ai-builder/integrations", "/docs/ai-builder/integrations/overview"),
9296
("/docs/ai-builder/app-lifecycle", "/docs/ai-builder/app-lifecycle/general"),

scripts/check_dead_links.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,23 @@ def normalize_url(self, url):
4545
normalized += f"?{parsed.query}"
4646
return normalized
4747

48+
def is_image_url(self, url):
49+
"""Check if URL points to an image file."""
50+
image_extensions = {
51+
".webp",
52+
".png",
53+
".jpg",
54+
".jpeg",
55+
".gif",
56+
".svg",
57+
".ico",
58+
".bmp",
59+
".tiff",
60+
}
61+
parsed = urlparse(url)
62+
path_lower = parsed.path.lower()
63+
return any(path_lower.endswith(ext) for ext in image_extensions)
64+
4865
def check_link(self, url, source_page):
4966
"""Check if a single link is working."""
5067
if url in self.checked_links:
@@ -113,7 +130,9 @@ def extract_links(self, html, page_url):
113130

114131
if url:
115132
absolute_url = urljoin(page_url, url)
116-
if not absolute_url.startswith(("javascript:", "mailto:", "tel:")):
133+
if not absolute_url.startswith(
134+
("javascript:", "mailto:", "tel:", "data:")
135+
):
117136
links.append(absolute_url)
118137

119138
return links
@@ -139,9 +158,10 @@ def crawl_page(self, url):
139158
links = self.extract_links(response.text, url)
140159

141160
for link in links:
142-
self.check_link(link, url)
161+
# Only check internal links and skip images
162+
if self.is_internal_url(link) and not self.is_image_url(link):
163+
self.check_link(link, url)
143164

144-
if self.is_internal_url(link):
145165
normalized = self.normalize_url(link)
146166
if normalized not in self.visited_pages:
147167
self.pages_to_visit.append(normalized)

0 commit comments

Comments
 (0)