diff --git a/src/repo.v b/src/repo.v index e249ea3c..cb7a4c7a 100644 --- a/src/repo.v +++ b/src/repo.v @@ -832,7 +832,11 @@ fn find_readme_file(items []File) ?File { } fn find_license_file(items []File) ?File { - files := items.filter(it.name.to_lower() == 'license') + // List of common license file names + license_common_files := ['license', 'license.md', 'license.txt', 'licence', 'licence.md', 'licence.txt'] + + files := items.filter(license_common_files.contains(it.name.to_lower())) + if files.len == 0 { return none } diff --git a/src/repo_routes.v b/src/repo_routes.v index 77b55ca9..a6b11756 100644 --- a/src/repo_routes.v +++ b/src/repo_routes.v @@ -420,7 +420,7 @@ pub fn (mut app App) tree(mut ctx Context, username string, repo_name string, br mut license_file_path := '' if license_file.id != 0 { - license_file_path = '/${username}/${repo_name}/blob/${branch_name}/LICENSE' + license_file_path = '/${username}/${repo_name}/blob/${branch_name}/${license_file.name}' } watcher_count := app.get_count_repo_watchers(repo_id)