Skip to content

Commit 78c1528

Browse files
committed
update documentation link generate method
1 parent c0466b4 commit 78c1528

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

index.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1 class="mt-5 text-5xl font-semibold text-gray-800">Laravel Upgrade Helper</h1
6969

7070
<div class="text-center">
7171
For upgrade guide see:
72-
<a :href="guideLink" target="_blank" class="underline italic">link</a>
72+
<a :href="documentationLink" target="_blank" class="underline italic">link</a>
7373
</div>
7474

7575
<div class="text-center">
@@ -210,13 +210,16 @@ <h3 class="text-xl font-semibold text-gray-900 dark:text-white">
210210
return 'https://github.com/laravel/laravel/releases/tag/' + this.upgradeVersion;
211211
},
212212

213-
guideLink() {
213+
documentationLink() {
214214
if (this.upgradeVersion) {
215-
let version = this.upgradeVersion.replace('v', '');
216-
version = version[0] >= 6 ? version[0] + '.x' : version.slice(0, 3);
215+
const splitVersion = this.upgradeVersion.split('.');
216+
const majorVersion = parseInt(splitVersion[0].replace('v', ''));
217+
const minorVersion = majorVersion === 5 ? splitVersion[1] : 'x';
217218

218-
return 'https://laravel.com/docs/' + version + '/upgrade';
219+
return `https://laravel.com/docs/${majorVersion}.${minorVersion}/upgrade`;
219220
}
221+
222+
return '';
220223
},
221224

222225
diffFileLink() {

0 commit comments

Comments
 (0)