File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import ThemeToggle from '@/components/theme-toggle';
8
8
import Mermaid from '../components/Mermaid' ;
9
9
import ConfigurationModal from '@/components/ConfigurationModal' ;
10
10
import ProcessedProjects from '@/components/ProcessedProjects' ;
11
- import { extractUrlPath } from '@/utils/urlDecoder' ;
11
+ import { extractUrlPath , extractUrlDomain } from '@/utils/urlDecoder' ;
12
12
import { useProcessedProjects } from '@/hooks/useProcessedProjects' ;
13
13
14
14
import { useLanguage } from '@/contexts/LanguageContext' ;
@@ -160,7 +160,18 @@ export default function Home() {
160
160
owner = 'local' ;
161
161
}
162
162
else if ( customGitRegex . test ( input ) ) {
163
- type = 'web' ;
163
+ // Detect repository type based on domain
164
+ const domain = extractUrlDomain ( input ) ;
165
+ if ( domain ?. includes ( 'github.com' ) ) {
166
+ type = 'github' ;
167
+ } else if ( domain ?. includes ( 'gitlab.com' ) || domain ?. includes ( 'gitlab.' ) ) {
168
+ type = 'gitlab' ;
169
+ } else if ( domain ?. includes ( 'bitbucket.org' ) || domain ?. includes ( 'bitbucket.' ) ) {
170
+ type = 'bitbucket' ;
171
+ } else {
172
+ type = 'web' ; // fallback for other git hosting services
173
+ }
174
+
164
175
fullPath = extractUrlPath ( input ) ?. replace ( / \. g i t $ / , '' ) ;
165
176
const parts = fullPath ?. split ( '/' ) ?? [ ] ;
166
177
if ( parts . length >= 2 ) {
You can’t perform that action at this time.
0 commit comments