Skip to content

Commit f9be824

Browse files
committed
fix(redirects): check for actual doc instead of path
1 parent 7f99fc6 commit f9be824

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/rari-tools/src/redirects.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -643,15 +643,10 @@ fn validate_to_url(url: &str, locale: Locale) -> Result<(), ToolError> {
643643
let bare_url = url.split('#').next().unwrap_or("");
644644

645645
let UrlMeta {
646-
folder_path: path,
647-
locale: to_locale,
648-
..
646+
folder_path: path, ..
649647
} = url_meta_from(bare_url)?;
650648

651-
let path = root_for_locale(to_locale)?
652-
.join(to_locale.as_folder_str())
653-
.join(path);
654-
if !path.exists() {
649+
if !Page::exists(bare_url) {
655650
return Err(ToolError::InvalidRedirectToURL(format!(
656651
"To-URL '{}' resolves to a non-existing file/folder at '{}' for locale '{}'.",
657652
url,

0 commit comments

Comments
 (0)