Skip to content

Commit ae5bc2d

Browse files
committed
✨ 为网站新增了备案号以及google所需的assetlinks.json文件
1 parent 6a51974 commit ae5bc2d

File tree

7 files changed

+102
-14
lines changed

7 files changed

+102
-14
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script setup lang="ts">
2+
import { getBeianCode } from "./IncFooterScript.vue";
3+
const year = new Date().getFullYear();
4+
const beian = getBeianCode();
5+
</script>
6+
<template>
7+
<footer>
8+
<a href="https://beian.miit.gov.cn/#/Integrated/recordQuery">{{ beian }}</a>
9+
版权所有 © 2021-{{ year }}
10+
<a href="https://github.com/BioforestChain/dweb_browser">BioforestChain</a>
11+
</footer>
12+
</template>
13+
<style lang="scss">
14+
footer {
15+
margin-top: 8em;
16+
font-size: 12px;
17+
text-align: center;
18+
a {
19+
color: var(--vp-c-brand-1);
20+
}
21+
}
22+
</style>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<script lang="ts">
2+
export function getBeianCode(hostname = location.hostname) {
3+
if (
4+
hostname === "dweb-browser.com" ||
5+
hostname.endsWith("dweb-browser.com")
6+
) {
7+
return "闽ICP备2022016659号-2";
8+
}
9+
10+
if (hostname === "dweb-browser.bagen.info" || hostname === "localhost") {
11+
return "闽ICP备2022016659号";
12+
}
13+
return "";
14+
}
15+
</script>
16+
<script setup lang="ts">
17+
const hook = () => {
18+
const beian = document.getElementById("beian");
19+
if (beian) {
20+
beian.innerHTML = getBeianCode();
21+
return true;
22+
}
23+
return false;
24+
};
25+
document.addEventListener("DOMContentLoaded", hook);
26+
if (!hook()) {
27+
requestAnimationFrame(hook);
28+
}
29+
</script>
30+
<template></template>
31+
<style lang="css"></style>

docs/.vitepress/config.mts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
import { defaultHoverInfoProcessor, transformerTwoslash } from "@shikijs/vitepress-twoslash";
2-
import { groupIconMdPlugin ,groupIconVitePlugin} from "vitepress-plugin-group-icons";
1+
import {
2+
defaultHoverInfoProcessor,
3+
transformerTwoslash,
4+
} from "@shikijs/vitepress-twoslash";
5+
import {
6+
groupIconMdPlugin,
7+
groupIconVitePlugin,
8+
} from "vitepress-plugin-group-icons";
39
import { defineConfig } from "vitepress";
410
// import { ar, arSearch } from "./ar.mts";
511
import { en, enSearch } from "./en.mts";
612
// import { es, esSearch } from "./es.mts";
713
import vite from "./vite.config.mts";
814
import { zh, zhSearch } from "./zh.mts";
915

16+
const js = String.raw;
1017
// https://vitepress.dev/reference/site-config
1118
export default defineConfig({
1219
title: "DwebBrowser",
@@ -19,7 +26,7 @@ export default defineConfig({
1926
dark: "vitesse-dark",
2027
},
2128
config(md) {
22-
md.use(groupIconMdPlugin)
29+
md.use(groupIconMdPlugin);
2330
},
2431
codeTransformers: [
2532
transformerTwoslash({
@@ -28,13 +35,13 @@ export default defineConfig({
2835
target: 99,
2936
moduleResolution: 99,
3037
module: 199,
31-
}
38+
},
3239
},
3340
// errorRendering: 'hover',
3441
processHoverInfo(info) {
3542
return defaultHoverInfoProcessor(info)
3643
// Remove shiki_core namespace
37-
.replace(/_shikijs_core\w*\./g, '')
44+
.replace(/_shikijs_core\w*\./g, "");
3845
},
3946
}),
4047
],
@@ -70,8 +77,8 @@ export default defineConfig({
7077
vue: {
7178
template: {
7279
compilerOptions: {
73-
isCustomElement: (tag) => tag === "dweb-wallpaper"
74-
}
75-
}
80+
isCustomElement: (tag) => tag === "dweb-wallpaper",
81+
},
82+
},
7683
},
7784
});

docs/.vitepress/theme/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// https://vitepress.dev/guide/custom-theme
22
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
3-
import 'virtual:group-icons.css'
3+
import "virtual:group-icons.css";
44
import "@shikijs/vitepress-twoslash/style.css";
55
import "uno.css";
66
import type { EnhanceAppContext } from "vitepress";
77
import { default as DefaultTheme, default as Theme } from "vitepress/theme";
88
import { h } from "vue";
99
import IndexBackground from "../components/IndexBackground.vue";
1010
import HeroActions from "../components/HeroActions.vue";
11+
import IncFooter from "../components/IncFooter.vue";
12+
import IncFooterScript from "../components/IncFooterScript.vue";
1113
import "./style/var.css";
1214

1315
export default {
@@ -19,6 +21,8 @@ export default {
1921
return h(DefaultTheme.Layout, null, {
2022
"home-hero-before": () => h(IndexBackground),
2123
"home-hero-actions-after": () => h(HeroActions),
24+
"doc-after": () => h(IncFooter),
25+
"layout-bottom": () => h(IncFooterScript),
2226
});
2327
},
2428
};

docs/.vitepress/zh.mts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { defineConfig, type DefaultTheme } from "vitepress";
1+
import { type DefaultTheme, defineConfig } from "vitepress";
22
import { navPlugins } from "./navPlugins";
33

4+
const html = String.raw;
45
export const zh = defineConfig({
56
lang: "zh-Hans",
67
description: "一个提供分布式网络 | 应用附着的浏览器。",
@@ -23,7 +24,11 @@ export const zh = defineConfig({
2324

2425
footer: {
2526
message: "基于 MIT 许可发布",
26-
copyright: `版权所有 © 2021-${new Date().getFullYear()} BFChain`,
27+
copyright: html`
28+
<a id="beian" href="https://beian.miit.gov.cn/#/Integrated/recordQuery"></a>
29+
版权所有 © 2021-${
30+
new Date().getFullYear()
31+
} <a href="https://github.com/BioforestChain/dweb_browser">BioforestChain</a>`,
2732
},
2833

2934
docFooter: {
@@ -79,11 +84,13 @@ function nav(): DefaultTheme.NavItem[] {
7984
items: [
8085
{
8186
text: "开发日志",
82-
link: "https://github.com/BioforestChain/dweb_browser/blob/main/monthly.md",
87+
link:
88+
"https://github.com/BioforestChain/dweb_browser/blob/main/monthly.md",
8389
},
8490
{
8591
text: "入门核心开发者",
86-
link: "https://github.com/BioforestChain/dweb_browser/blob/main/GET_START_FOR_DEVELOPER.md",
92+
link:
93+
"https://github.com/BioforestChain/dweb_browser/blob/main/GET_START_FOR_DEVELOPER.md",
8794
},
8895
],
8996
},
@@ -130,7 +137,7 @@ function navPlaoc(): (
130137
navItems = navItems.concat(
131138
item.items.map((it) => {
132139
return { text: it.text!, link: base + it.link! };
133-
})
140+
}),
134141
);
135142
}
136143
}

docs/.well-known/assetlinks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{
3+
"relation": [
4+
"delegate_permission/common.handle_all_urls"
5+
],
6+
"target": {
7+
"namespace": "android_app",
8+
"package_name": "info.bagen.dwebbrowser",
9+
"sha256_cert_fingerprints": [
10+
"6F:9A:45:84:95:07:36:1A:93:D5:E1:05:AE:79:FE:EB:AE:8B:8A:D0:58:74:14:B0:3C:30:E2:64:27:F6:26:C5"
11+
]
12+
}
13+
}
14+
]
15+

docs/components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ declare module 'vue' {
1010
Badges: typeof import('./.vitepress/components/Badges.vue')['default']
1111
DownloadLink: typeof import('./.vitepress/components/DownloadLink.vue')['default']
1212
HeroActions: typeof import('./.vitepress/components/HeroActions.vue')['default']
13+
IncFooter: typeof import('./.vitepress/components/IncFooter.vue')['default']
14+
IncFooterScript: typeof import('./.vitepress/components/IncFooterScript.vue')['default']
1315
IndexBackground: typeof import('./.vitepress/components/IndexBackground.vue')['default']
1416
Platform: typeof import('./.vitepress/components/Platform.vue')['default']
1517
}

0 commit comments

Comments
 (0)