Skip to content

Commit

Permalink
pwa test
Browse files Browse the repository at this point in the history
  • Loading branch information
tobylai-toby committed Sep 22, 2024
1 parent d853587 commit 796c657
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
34 changes: 31 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
remarkPlugins: [[tabBlocks,{}]],
remarkPlugins: [[tabBlocks, {}]],
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
Expand Down Expand Up @@ -135,7 +135,7 @@ const config = {
darkTheme: prismThemes.vsDark,
},
}),
themes:[
themes: [
[
require.resolve("@easyops-cn/docusaurus-search-local"),
({
Expand All @@ -144,7 +144,7 @@ const config = {
explicitSearchResultPath: true,
}),
],
],plugins:[
], plugins: [
// [
// 'vercel-analytics',
// {
Expand Down Expand Up @@ -176,6 +176,34 @@ const config = {
// out: "/docs/areact/api/components"
// },
// ],
[
'@docusaurus/plugin-pwa',
{
// debug: true,
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/trclogo.png',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json', // your PWA manifest
},
{
tagName: 'meta',
name: 'theme-color',
content: '#7345c4',
},
],
},
],
]
};

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-pwa": "^3.5.2",
"@docusaurus/plugin-vercel-analytics": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@easyops-cn/docusaurus-search-local": "^0.44.5",
Expand Down
15 changes: 15 additions & 0 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Box3TRC 文档",
"short_name": "岛研所文档",
"start_url": ".",
"display": "standalone",
"background_color": "#7345c4",
"description": "Box3TRC文档,🔬 Box3TRC 「Technical Research Center」🔬 欢迎来到岛研所! ",
"icons": [
{
"src": "/img/trclogo.png",
"sizes": "48x48",
"type": "image/png"
}
]
}

0 comments on commit 796c657

Please sign in to comment.