Skip to content

Commit a59d0ed

Browse files
authored
scripts/set-alias-page: default page title to filename (#19522)
1 parent b30fdf6 commit a59d0ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/set-alias-page.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,14 @@ def prompt_alias_page_info(page_path: str) -> AliasPageContent:
374374
)
375375
)
376376
print(create_colored_line(Colors.GREEN, "Example: npm run-script"))
377-
title = input(create_colored_line(Colors.CYAN, "Enter page title: ")).strip()
377+
page_name = Path(page_path).stem
378+
title = input(
379+
create_colored_line(
380+
Colors.CYAN, f"Enter page title (press Enter to use {page_name}): "
381+
)
382+
).strip()
378383
if not title:
379-
raise SystemExit(create_colored_line(Colors.RED, "Title cannot be empty"))
384+
title = page_name
380385

381386
print(
382387
create_colored_line(

0 commit comments

Comments
 (0)