Skip to content

Commit e286ab7

Browse files
committed
update
1 parent da2e2cd commit e286ab7

File tree

19 files changed

+937
-469
lines changed

19 files changed

+937
-469
lines changed

.github/workflows/deploy-website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setup Pages
3838
uses: actions/configure-pages@v5
3939
- name: Install dependencies
40-
run: yarn install --frozen-lockfile
40+
run: yarn install --frozen-lockfile --force
4141
- name: Build with VitePress
4242
run: |
4343
yarn docs:build

docs/.vitepress/config.ts

Lines changed: 106 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,109 @@
1-
import { defineConfig, SiteConfig } from 'vitepress'
2-
import locales from './locales'
1+
import { defineConfig, HeadConfig, SiteConfig } from "vitepress";
2+
import locales from "./locales";
3+
import ViteYaml from "@modyfi/vite-plugin-yaml";
4+
import { writeFile, readFile } from "fs/promises";
5+
import { parse } from "yaml";
6+
import { resolve } from "path";
7+
import { repositoriesJSONstringify } from "../data/repositories";
38

4-
export default defineConfig(
5-
{
6-
markdown: {
7-
lineNumbers: true
8-
},
9-
title: 'MMRL',
10-
locales: locales.locales,
11-
sitemap: {
12-
hostname: 'https://mmrl.dev'
9+
export default defineConfig({
10+
vite: {
11+
plugins: [ViteYaml()],
12+
},
13+
markdown: {
14+
lineNumbers: true,
15+
},
16+
title: "MMRL",
17+
locales: locales.locales,
18+
sitemap: {
19+
hostname: "https://mmrl.dev",
20+
},
21+
head: [
22+
[
23+
"script",
24+
{
25+
async: "async",
26+
src: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5042729416879007",
27+
crossorigin: "anonymous",
28+
},
29+
],
30+
],
31+
transformHead: ({ pageData }) => {
32+
const head: HeadConfig[] = [];
33+
34+
if (pageData.frontmatter.description) {
35+
head.push([
36+
"meta",
37+
{
38+
property: "og:description",
39+
content: pageData.frontmatter.description,
1340
},
14-
head: [
15-
[
16-
'script',
17-
{
18-
async: 'async',
19-
src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5042729416879007',
20-
crossorigin: 'anonymous',
21-
}
22-
],
23-
],
41+
]);
2442
}
25-
)
43+
44+
if (pageData.frontmatter.image) {
45+
head.push([
46+
"meta",
47+
{ property: "og:image", content: pageData.frontmatter.image },
48+
]);
49+
}
50+
51+
head.push([
52+
"meta",
53+
{
54+
property: "og:url",
55+
content: `https://mmrl.dev${pageData.relativePath}`,
56+
},
57+
]);
58+
59+
head.push(["meta", { property: "og:type", content: "website" }]);
60+
61+
head.push(["meta", { property: "og:site_name", content: "MMRL" }]);
62+
63+
head.push(["meta", { property: "og:locale", content: "en_US" }]);
64+
65+
head.push(["meta", { name: "twitter:card", content: "summary" }]);
66+
67+
head.push(["meta", { name: "twitter:site", content: "@Der_Googler" }]);
68+
69+
head.push(["meta", { name: "twitter:creator", content: "@Der_Googler" }]);
70+
71+
head.push([
72+
"meta",
73+
{ name: "twitter:title", content: pageData.frontmatter.title },
74+
]);
75+
76+
head.push([
77+
"meta",
78+
{
79+
name: "twitter:description",
80+
content: pageData.frontmatter.description,
81+
},
82+
]);
83+
84+
if (pageData.frontmatter.image) {
85+
head.push([
86+
"meta",
87+
{ name: "twitter:image", content: pageData.frontmatter.image },
88+
]);
89+
90+
head.push([
91+
"meta",
92+
{ name: "twitter:image:alt", content: pageData.frontmatter.title },
93+
]);
94+
}
95+
96+
return head;
97+
},
98+
buildEnd: async (config: SiteConfig) => {
99+
const publicApi = resolve(config.outDir, "api");
100+
// const repositoriesYaml = resolve(publicApi, "repositories.yaml");
101+
const publicRepoList = resolve(publicApi, "gg");
102+
103+
// const readContent = await readFile(repositoriesYaml, "utf8");
104+
// const par = parse(readContent);
105+
106+
console.log("Writing repositories.json");
107+
await writeFile(publicRepoList, repositoriesJSONstringify);
108+
},
109+
});

docs/.vitepress/locales/en.ts

Lines changed: 80 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,125 @@
1-
import { createRequire } from 'module'
2-
import { defineConfig } from 'vitepress'
1+
import { createRequire } from "module";
2+
import { defineConfig } from "vitepress";
3+
import { repositories } from "../../data/repositories";
34

4-
const require = createRequire(import.meta.url)
5-
const pkg = require('vitepress/package.json')
5+
const require = createRequire(import.meta.url);
6+
const pkg = require("vitepress/package.json");
67

78
export default defineConfig({
8-
lang: 'en-US',
9-
description: 'Build your own modules repository',
9+
lang: "en-US",
10+
description: "Build your own modules repository",
1011

1112
themeConfig: {
1213
nav: nav(),
1314

14-
lastUpdatedText: 'last Updated',
15+
lastUpdatedText: "last Updated",
1516

1617
sidebar: {
17-
'/guide/': sidebarGuide(),
18-
'/legal/': sidebarLegal()
18+
"/guide/": sidebarGuide(),
19+
"/repository/": sidebarRepositories(),
20+
"/legal/": sidebarLegal(),
1921
},
2022

2123
socialLinks: [
22-
{ icon: 'github', link: 'https://github.com/MMRLApp/MMRL' },
23-
{ icon: 'googleplay', link: 'https://play.google.com/store/apps/details?id=com.dergoogler.mmrl' }
24+
{ icon: "github", link: "https://github.com/MMRLApp/MMRL" },
25+
{
26+
icon: "googleplay",
27+
link: "https://play.google.com/store/apps/details?id=com.dergoogler.mmrl",
28+
},
2429
],
2530

2631
footer: {
27-
message: 'Released under the GPL3 License.',
28-
copyright: 'Copyright © 2022-present Der_Googler and its contributors'
32+
message: "Released under the GPL3 License.",
33+
copyright: "Copyright © 2022-present Der_Googler and its contributors",
2934
},
3035

3136
editLink: {
32-
pattern: 'https://github.com/MMRLApp/MMRLApp.github.io/edit/master/docs/:path',
33-
text: 'Edit this page on GitHub'
34-
}
35-
}
36-
})
37+
pattern:
38+
"https://github.com/MMRLApp/MMRLApp.github.io/edit/master/docs/:path",
39+
text: "Edit this page on GitHub",
40+
},
41+
},
42+
});
3743

3844
function nav() {
3945
return [
40-
{ text: 'Guide', link: '/guide' },
41-
{ text: 'Legal', link: '/legal/privacy' },
42-
]
46+
{ text: "Guide", link: "/guide" },
47+
{ text: "Repositories", link: "/repository/gmr" },
48+
{ text: "Legal", link: "/legal/privacy" },
49+
];
4350
}
4451

4552
function sidebarGuide() {
4653
return [
4754
{
48-
text: 'Guide',
55+
text: "Guide",
4956
items: [
50-
{ text: 'What is MMRL', link: '/guide/' },
51-
{ text: 'Anti-Features', link: '/guide/antifeatures' },
52-
{ text: 'Installer API', link: '/guide/installer' },
53-
{ text: 'Repositories', link: '/guide/repositories' },
57+
{ text: "What is MMRL", link: "/guide/" },
58+
{ text: "Anti-Features", link: "/guide/antifeatures" },
59+
{ text: "Installer API", link: "/guide/installer" },
5460
{
55-
text: 'WebUI',
61+
text: "WebUI",
5662
collapsed: true,
5763
items: [
58-
{ text: 'Getting Started', link: '/guide/webui/' },
64+
{ text: "Getting Started in WebUI", link: "/guide/webui/" },
5965
{
60-
text: 'API',
66+
text: "API",
67+
collapsed: true,
6168
items: [
62-
{ text: 'FileSystem', link: '/guide/webui/api/filesystem' },
63-
{ text: 'MMRLInterface', link: '/guide/webui/api/mmrlinterface' },
64-
{ text: 'Toast', link: '/guide/webui/api/toast' },
65-
{ text: 'VersionInterface', link: '/guide/webui/api/versioninterface' },
66-
]
69+
{ text: "FileSystem", link: "/guide/webui/api/filesystem" },
70+
{
71+
text: "MMRLInterface",
72+
link: "/guide/webui/api/mmrlinterface",
73+
},
74+
{ text: "Toast", link: "/guide/webui/api/toast" },
75+
{
76+
text: "VersionInterface",
77+
link: "/guide/webui/api/versioninterface",
78+
},
79+
],
6780
},
68-
]
81+
],
6982
},
7083
{
71-
text: 'MMRL-Util',
84+
text: "MMRL-Util",
7285
collapsed: true,
7386
items: [
74-
{ text: 'Getting Started', link: '/guide/mmrl-util/' },
75-
{ text: 'repo.json', link: '/guide/mmrl-util/repo-json' },
76-
{ text: 'track.json', link: '/guide/mmrl-util/track-json' },
77-
{ text: 'config.json', link: '/guide/mmrl-util/config-json' },
78-
]
87+
{ text: "Getting Started", link: "/guide/mmrl-util/" },
88+
{ text: "repo.json", link: "/guide/mmrl-util/repo-json" },
89+
{ text: "track.json", link: "/guide/mmrl-util/track-json" },
90+
{ text: "config.json", link: "/guide/mmrl-util/config-json" },
91+
],
7992
},
80-
{ text: 'FAQ', link: '/guide/faq' },
81-
]
82-
}
83-
]
93+
{ text: "FAQ", link: "/guide/faq" },
94+
],
95+
},
96+
];
8497
}
8598

86-
8799
function sidebarLegal() {
88100
return [
89101
{
90-
text: 'Legal',
102+
text: "Legal",
91103
items: [
92-
{ text: 'Privacy Policy', link: '/legal/privacy' },
93-
{ text: 'Chat Rules', link: '/legal/chat-rules' },
94-
]
95-
}
96-
]
104+
{ text: "Privacy Policy", link: "/legal/privacy" },
105+
{ text: "Chat Rules", link: "/legal/chat-rules" },
106+
],
107+
},
108+
];
109+
}
110+
111+
function repos() {
112+
return repositories.map((repo) => ({
113+
text: repo.name,
114+
link: `/repository/${repo.slug}`,
115+
}));
116+
}
117+
118+
function sidebarRepositories() {
119+
return [
120+
{
121+
text: "Repositories",
122+
items: repos(),
123+
},
124+
];
97125
}

docs/data/repositories.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { readFileSync } from "fs";
2+
import { join } from "path";
3+
import { parse } from "yaml";
4+
5+
export const fileName = join(__dirname, "repositories.yaml");
6+
7+
export const repositories: any = parse(readFileSync(fileName, "utf8"));
8+
export const repositoriesJSONstringify: string = JSON.stringify(
9+
repositories,
10+
null,
11+
4
12+
);

docs/data/repositories.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
- slug: gmr
2+
name: Googlers Magisk Repo
3+
maintainers: []
4+
url: https://gr.dergoogler.com/gmr/
5+
6+
- slug: mmar
7+
name: Magisk Modules Alternative Repo
8+
maintainers: []
9+
url: https://magisk-modules-alt-repo.github.io/json-v2/
10+
11+
- slug: imr
12+
name: IzzyOnDroid Magisk Repository
13+
maintainers: []
14+
url: https://apt.izzysoft.de/magisk/
15+
16+
- slug: mmrr
17+
name: Magisk Modules Rikj000 Repo
18+
maintainers: []
19+
url: https://rikj000.github.io/Magisk-Modules-Rikj000-Repo/
20+
21+
- slug: cmmr
22+
name: Celica Magisk Modules Repo
23+
maintainers: []
24+
url: https://natsumerinchan.github.io/celica-magisk-modules-repo/
25+
26+
- slug: mfcr
27+
name: Magisk Font Collection Repository
28+
maintainers: []
29+
url: https://codeberg.org/fruitsnack/magisk-font-repo/raw/branch/main/
30+
31+
- slug: lmr
32+
name: LelouBil Magisk Repo
33+
maintainers: []
34+
url: https://leloubil.github.io/magisk-repo/
35+
36+
- slug: m-mr
37+
name: Misaki-Modules Repo
38+
maintainers: []
39+
url: https://misak10.github.io/mmrl-repo/

docs/guide/repositories.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)