Skip to content

Commit e163faa

Browse files
committed
add modules
1 parent 14c2d88 commit e163faa

File tree

10 files changed

+2520
-17
lines changed

10 files changed

+2520
-17
lines changed

.github/workflows/deploy-website.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Deploy Website
22

33
on:
4+
schedule:
5+
- cron: '0 */6 * * *'
46
push:
57
branches:
68
- master

docs/.vitepress/locales/en.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createRequire } from "module";
22
import { defineConfig } from "vitepress";
3+
import request from "sync-request";
34
import { repositories } from "../../data/repositories";
45

56
const require = createRequire(import.meta.url);
@@ -44,7 +45,7 @@ export default defineConfig({
4445
function nav() {
4546
return [
4647
{ text: "Guide", link: "/guide" },
47-
{ text: "Repositories", link: "/repository/gmr" },
48+
{ text: "Repositories", link: "/repository" },
4849
{ text: "Legal", link: "/legal/privacy" },
4950
];
5051
}
@@ -110,10 +111,23 @@ function sidebarLegal() {
110111
}
111112

112113
function repos() {
113-
return repositories.map((repo) => ({
114-
text: repo.name,
115-
link: `/repository/${repo.slug}`,
116-
}));
114+
return repositories.map((repo) => {
115+
const response = request("GET", `${repo.url}json/modules.json`);
116+
const rep = JSON.parse(response.getBody("utf8"));
117+
const modules = rep.modules.map((module) => {
118+
return {
119+
text: module.name,
120+
link: `/repository/${repo.id}/${module.id}`,
121+
};
122+
});
123+
124+
return {
125+
text: repo.name,
126+
link: `/repository/${repo.id}`,
127+
collapsed: true,
128+
items: modules,
129+
};
130+
});
117131
}
118132

119133
function sidebarRepositories() {

docs/data/repositories.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
- slug: gmr
1+
- id: gmr
22
name: Googlers Magisk Repo
33
maintainers: []
44
url: https://gr.dergoogler.com/gmr/
55

6-
- slug: mmar
6+
- id: mmar
77
name: Magisk Modules Alternative Repo
88
maintainers: []
99
url: https://magisk-modules-alt-repo.github.io/json-v2/
1010

11-
- slug: imr
11+
- id: imr
1212
name: IzzyOnDroid Magisk Repository
1313
maintainers: []
1414
url: https://apt.izzysoft.de/magisk/
1515

16-
- slug: mmrr
16+
- id: mmrr
1717
name: Magisk Modules Rikj000 Repo
1818
maintainers: []
1919
url: https://rikj000.github.io/Magisk-Modules-Rikj000-Repo/
2020

21-
- slug: cmmr
21+
- id: cmmr
2222
name: Celica Magisk Modules Repo
2323
maintainers: []
2424
url: https://natsumerinchan.github.io/celica-magisk-modules-repo/
2525

26-
- slug: mfcr
26+
- id: mfcr
2727
name: Magisk Font Collection Repository
2828
maintainers: []
2929
url: https://codeberg.org/fruitsnack/magisk-font-repo/raw/branch/main/
3030

31-
- slug: lmr
31+
- id: lmr
3232
name: LelouBil Magisk Repo
3333
maintainers: []
3434
url: https://leloubil.github.io/magisk-repo/
3535

36-
- slug: m-mr
36+
- id: m-mr
3737
name: Misaki-Modules Repo
3838
maintainers: []
3939
url: https://misak10.github.io/mmrl-repo/

docs/repository/[name].md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
editLink: false
3+
prev: false
4+
next: false
5+
---
6+
17
<script setup>
28
import { ref, onMounted } from "vue";
39
import { useData } from 'vitepress'
@@ -6,7 +12,7 @@ import repositories from '../data/repositories.yaml'
612
const { params } = useData()
713

814
const name = params.value.name
9-
const repository = repositories.find((repo) => repo.slug === name)
15+
const repository = repositories.find((repo) => repo.id === name)
1016

1117
const data = ref(null);
1218

@@ -36,7 +42,7 @@ const openUrl = (url) => {
3642
<div :class="$style.items" v-for="module in data.modules">
3743
<div :class="$style.item">
3844
<div :class="[$style.feature, $style.grid_4]">
39-
<article :class="$style.box">
45+
<article :class="$style.box" @click="openUrl($params.name + '/' + module.id)">
4046
<h2 :class="$style.title" :id="module.id">{{ module.name }}</h2>
4147
<span :class="$style.author">
4248
{{ module.version }} ({{ module.versionCode }}) by

docs/repository/[name].paths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { repositories } from "../data/repositories";
33
const parsedRepos = repositories.map((repo) => {
44
return {
55
params: {
6-
name: repo.slug,
6+
name: repo.id,
77
},
88
};
99
});

docs/repository/[name]/[id].md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
title: Module
3+
editLink: false
4+
prev: false
5+
next: false
6+
---
7+
8+
<script setup>
9+
import { ref, onMounted } from 'vue'
10+
import { useData } from 'vitepress'
11+
12+
const { params } = useData()
13+
14+
const module = ref(params.value.module)
15+
16+
document.title = module.value.name + " | MMRL"
17+
18+
const openUrl = (url) => {
19+
window.open(url);
20+
};
21+
</script>
22+
23+
24+
<img v-if="module.cover" :class="$style.moduleCover" :src="module.cover"/>
25+
26+
# {{ module.name }}
27+
28+
<Badge :style="{ marginTop: '8px' }" type="tip" :text="module.version" /> <Badge type="warning" :text="module.versionCode" /> <span v-if="module.verified" :class="[$style.chip, $style.chipGreen]">Verified</span>
29+
30+
<div v-if="module.note">
31+
32+
> [!NOTE]
33+
> {{ module.note.message }}
34+
35+
</div>
36+
37+
{{ module.description }}
38+
39+
<div :class="$style.moduleActions">
40+
<a v-if="module.versions" :href="module.versions[0].zipUrl" target="_blank" :class="[$style.VPButton, $style.VPButton_medium, $style.VPButton_brand]">Download latest version</a>
41+
<a v-if="module.support" :href="module.support" target="_blank" :class="[$style.VPButton, $style.VPButton_medium, $style.VPButton_alt]">Support</a>
42+
</div>
43+
44+
<div v-if="module.screenshots && module.screenshots.length">
45+
<h2>Screenshots</h2>
46+
<div :class="$style.screenshotsContainer">
47+
<div v-for="(screenshot, index) in module.screenshots" :key="index" :class="$style.screenshot">
48+
<img :src="screenshot" alt="Module Screenshot" />
49+
</div>
50+
</div>
51+
</div>
52+
53+
54+
## Versions
55+
56+
<ul v-for="(version, index) in module.versions">
57+
<li>
58+
<a :href="version.zipUrl" :key="index">{{ version.version }} ({{ version.versionCode }})</a>
59+
</li>
60+
</ul>
61+
62+
## More
63+
64+
<div :class="$style.feature">
65+
<article :class="$style.box">
66+
License: {{ module.license }}<br/>
67+
Timestamp: {{ new Date(module.timestamp * 1000) }}
68+
</article>
69+
</div>
70+
71+
72+
<style module>
73+
.moduleCover {
74+
width: 100%;
75+
margin-bottom: 16px;
76+
border-radius: 16px;
77+
}
78+
79+
.moduleActions {
80+
display: flex;
81+
gap: 8px;
82+
}
83+
84+
.VPButton {
85+
display: inline-block;
86+
border: 1px solid transparent;
87+
text-align: center;
88+
font-weight: 600;
89+
white-space: nowrap;
90+
color: unset !important;
91+
text-decoration: unset !important;
92+
transition: color 0.25s, border-color 0.25s, background-color 0.25s;
93+
}
94+
95+
.VPButton_medium {
96+
border-radius: 20px;
97+
padding: 0 20px;
98+
line-height: 38px;
99+
font-size: 14px;
100+
}
101+
102+
.VPButton_alt {
103+
border-color: var(--vp-button-alt-border);
104+
color: var(--vp-button-alt-text);
105+
background-color: var(--vp-button-alt-bg);
106+
}
107+
108+
.VPButton_brand {
109+
border-color: var(--vp-button-brand-border);
110+
color: var(--vp-button-brand-text);
111+
background-color: var(--vp-button-brand-bg);
112+
}
113+
114+
.screenshotsContainer {
115+
display: flex;
116+
gap: 1rem;
117+
overflow-x: auto;
118+
}
119+
120+
.screenshot img {
121+
width: 200px;
122+
height: auto;
123+
border-radius: 12px;
124+
}
125+
126+
.feature {
127+
display: block;
128+
border: 1px solid var(--vp-c-bg-soft);
129+
border-radius: 12px;
130+
height: 100%;
131+
background-color: var(--vp-c-bg-soft);
132+
transition: border-color 0.25s, background-color 0.25s;
133+
}
134+
135+
.box {
136+
display: flex;
137+
flex-direction: column;
138+
padding: 24px;
139+
height: 100%;
140+
}
141+
142+
.chipContainer {
143+
display: flex;
144+
flex-wrap: wrap;
145+
margin: -8px;
146+
padding-top: 20px;
147+
}
148+
149+
.chipGreen {
150+
border-color: transparent;
151+
color: #b3ffa8;
152+
background-color: rgb(100 255 119 / 16%);
153+
}
154+
155+
.chipInfo {
156+
border-color: var(--vp-badge-info-border);
157+
color: var(--vp-badge-info-text);
158+
background-color: var(--vp-badge-info-bg);
159+
}
160+
161+
.chipDanger {
162+
border-color: var(--vp-badge-danger-border);
163+
color: var(--vp-badge-danger-text);
164+
background-color: var(--vp-badge-danger-bg);
165+
}
166+
167+
.chip {
168+
border-style: solid;
169+
border-width: 1px;
170+
display: inline-block;
171+
border-radius: 12px;
172+
padding: 0 10px;
173+
line-height: 22px;
174+
font-size: 12px;
175+
font-weight: 500;
176+
margin: 4px;
177+
transform: translateY(-2px);
178+
}
179+
</style>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { repositories } from "../../data/repositories";
2+
3+
export default {
4+
async paths() {
5+
const paths = await Promise.all(
6+
repositories.map(async (repo) => {
7+
const rep = await (await fetch(`${repo.url}json/modules.json`)).json();
8+
9+
const modulePaths = await Promise.all(
10+
rep.modules.map(async (module) => {
11+
return {
12+
title: module.title,
13+
description: module.description,
14+
params: {
15+
module: module,
16+
name: repo.id,
17+
id: module.id,
18+
},
19+
};
20+
})
21+
);
22+
23+
return modulePaths;
24+
})
25+
);
26+
27+
return paths.flat();
28+
},
29+
};
30+

docs/repository/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup>
2+
import repositories from '../data/repositories.yaml'
3+
</script>
4+
5+
# Repositories
6+
7+
:::info
8+
The website will be every 6 (six) hours re-deployed so that every repository will be updated at [mmrl.dev](https://mmrl.dev)!
9+
:::
10+
11+
<ul v-for="repository in repositories">
12+
<li>
13+
<a :href="repository.id">{{ repository.name }}</a>
14+
</li>
15+
</ul>

0 commit comments

Comments
 (0)