Skip to content

Commit

Permalink
feat: PWA and Analytics ready.
Browse files Browse the repository at this point in the history
PWA configuration completed.

Integrate vercel analytics plugins for more detailed analytics data
at vercel.
  • Loading branch information
n1cogrv committed Apr 26, 2024
1 parent b1b2f6b commit 2a7d6b8
Show file tree
Hide file tree
Showing 8 changed files with 1,895 additions and 393 deletions.
62 changes: 62 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,68 @@ const config = {
}
}
],
[
'@docusaurus/plugin-pwa',
{
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
injectManifestConfig: {
globPatterns: [
'**/*.{pdf,docx,doc}',
],
},
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/ipkb.png',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json',
},
{
tagName: 'meta',
name: 'theme-color',
content: 'rgb(29, 121, 22)',
},
{
tagName: 'meta',
name: 'apple-mobile-web-app-capable',
content: 'yes',
},
{
tagName: 'meta',
name: 'apple-mobile-web-app-status-bar-style',
content: '#1d7916',
},
{
tagName: 'link',
rel: 'apple-touch-icon',
href: '/img/ipkb.png',
},
{
tagName: 'link',
rel: 'mask-icon',
href: '/img/logo.svg',
},
{
tagName: 'meta',
name: 'msapplication-TileImage',
content: '/img/ipkb.png',
},
{
tagName: 'meta',
name: 'msapplication-TileColor',
content: '#1d7916',
},
],
},
],

],

Expand Down
2,170 changes: 1,791 additions & 379 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ipkb",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -14,9 +14,11 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/plugin-client-redirects": "^3.1.1",
"@docusaurus/preset-classic": "3.1.1",
"@docusaurus/core": "^3.2.1",
"@docusaurus/plugin-client-redirects": "^3.2.1",
"@docusaurus/plugin-pwa": "^3.2.1",
"@docusaurus/plugin-vercel-analytics": "^3.2.1",
"@docusaurus/preset-classic": "^3.2.1",
"@easyops-cn/docusaurus-search-local": "^0.40.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
Expand All @@ -25,8 +27,8 @@
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
"@docusaurus/types": "3.1.1",
"@docusaurus/module-type-aliases": "^3.2.1",
"@docusaurus/types": "^3.2.1",
"typescript": "^5.4.2"
},
"browserslist": {
Expand Down
1 change: 0 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function HomepageHeader() {
to="/search">
全站检索 🔍
</Link>

</div>
</div>
</header>
Expand Down
7 changes: 0 additions & 7 deletions src/pages/markdown-page.md

This file was deleted.

Binary file added static/img/ipkb-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/ipkb-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Intellectual Property Knowledge Base",
"short_name": "IPKB",
"description": "Intellectual Property Knowledge Base, 知产智库",
"theme_color": "#1d7916",
"background_color": "#171717",
"display": "standalone",
"scope": "./",
"id": "./?offlineMode=true",
"start_url": "./?offlineMode=true",
"related_applications": [
{
"platform": "webapp",
"url": "https://ipkb.jasonchen.icu/manifest.json"
}
],
"icons": [
{
"src": "/img/logo.svg",
"sizes": "1000x1000",
"type": "image/svg+xml"
},
{
"src": "/img/ipkb-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/img/ipkb-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

0 comments on commit 2a7d6b8

Please sign in to comment.