Skip to content

Commit b8f9acc

Browse files
authored
feat: support tangled.sh (#182)
1 parent f48ba19 commit b8f9acc

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

src/sites/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { forgejo } from './forgejo';
33
import { gitea } from './gitea';
44
import { github } from './github';
55
import { gitlab } from './gitlab';
6+
import { tangled } from './tangled';
67

78
export type FnWithContext<T> = (
89
rowEl: HTMLElement,
@@ -35,7 +36,14 @@ export type Site = {
3536
// `.trim(),
3637
// };
3738

38-
export const sites: Array<Site> = [github, gitlab, gitea, forgejo, bitbucket];
39+
export const sites: Array<Site> = [
40+
github,
41+
gitlab,
42+
gitea,
43+
forgejo,
44+
bitbucket,
45+
tangled,
46+
];
3947
export const matches: Array<string> = sites
4048
.flatMap((site) => site.domains)
4149
.map((domain) => `*://${domain}/*`);

src/sites/tangled.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { ReplacementSelectorSet, Site } from '.';
2+
3+
const mainRepositoryImplementation: ReplacementSelectorSet = {
4+
row: '#file-tree > div, .tree > div',
5+
filename: 'a',
6+
icon: 'svg',
7+
isDirectory: (_rowEl, _fileNameEl, iconEl) =>
8+
iconEl.classList.contains('fill-current'),
9+
isSubmodule: (_rowEl, _fileNameEl, _iconEl) => false, // TODO: Implement isSubmodule.
10+
isCollapsable: (_rowEl, _fileNameEl, _iconEl) => false,
11+
};
12+
13+
export const tangled: Site = {
14+
domains: ['tangled.sh'],
15+
replacements: [mainRepositoryImplementation],
16+
};

wxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export default defineConfig({
8484
'https://gitea.com/gitea/gitea-mirror',
8585
'https://gitea.catppuccin.com/catppuccin/catppuccin',
8686
'https://bitbucket.org/atlassian/atlassian-frontend-mirror',
87+
'https://tangled.sh/@tangled.sh/core',
8788
],
8889
},
8990
});

0 commit comments

Comments
 (0)