Skip to content

Commit 4631604

Browse files
committed
fix(ci): correct tutorial preview URL generation in sync-untranslated-issue script
1 parent e93b833 commit 4631604

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/scripts/sync-untranslated-issue.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,20 @@ function generateLinks(filepath) {
8080
// .mdファイルのみプレビューURL生成
8181
let previewUrl = null;
8282
if (filepath.endsWith('.md')) {
83-
const previewPath = filepath
83+
let previewPath = filepath
8484
.replace('src/content/', '')
8585
.replace(/\/README\.md$/, '') // READMEの場合はディレクトリのみ
8686
.replace(/\.md$/, '');
87+
88+
// チュートリアルの特殊なパス変換
89+
if (previewPath.startsWith('tutorials/')) {
90+
// tutorials/first-app/intro -> tutorials/first-app
91+
// tutorials/first-app/steps/01-hello-world -> tutorials/first-app/01-hello-world
92+
previewPath = previewPath
93+
.replace(/\/intro$/, '') // intro ディレクトリを削除
94+
.replace(/\/steps\//, '/'); // steps/ を削除
95+
}
96+
8797
previewUrl = `https://angular.jp/${previewPath}`;
8898
}
8999

0 commit comments

Comments
 (0)