PWA 支持(测试)

This commit is contained in:
lilingfeng 2024-08-13 11:42:21 +08:00
parent 229b77a440
commit 762005f942
4 changed files with 1581 additions and 0 deletions

View File

@ -77,6 +77,32 @@ const config = {
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true,
}],[
'@docusaurus/plugin-pwa',
{
debug: true,
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/book.png',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json', // your PWA manifest
},
{
tagName: 'meta',
name: 'theme-color',
content: 'rgb(37, 194, 160)',
},
],
},
],
[

1532
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
"@docusaurus/core": "^3.5.1",
"@docusaurus/plugin-content-docs": "^3.5.1",
"@docusaurus/plugin-debug": "^3.5.1",
"@docusaurus/plugin-pwa": "^3.5.1",
"@docusaurus/plugin-sitemap": "^3.5.1",
"@docusaurus/preset-classic": "^3.5.1",
"@docusaurus/theme-mermaid": "^3.5.1",

22
static/manifest.json Normal file
View File

@ -0,0 +1,22 @@
{
"name": "笨蛋文档",
"short_name": "笨蛋文档",
"theme_color": "#2196f3",
"background_color": "#424242",
"display": "standalone",
"scope": "./",
"start_url": "./index.html",
"related_applications": [
{
"platform": "webapp",
"url": "https://yizhan.wiki/NitWikit/manifest.json"
}
],
"icons": [
{
"src": "img/book.png",
"sizes": "160x160",
"type": "image/png"
}
]
}