Skip to content

Commit

Permalink
docs: pwa support
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 5, 2021
1 parent 5780080 commit 3cd2303
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {

head: [
['link', { rel: 'icon', href: `/koishi.png` }],
// ['link', { rel: 'manifest', href: '/manifest.json' }],
['link', { rel: 'manifest', href: '/manifest.json' }],
['meta', { name: 'theme-color', content: '#5546a3' }],
// ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
// ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
Expand Down
16 changes: 16 additions & 0 deletions docs/.vuepress/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Koishi",
"short_name": "Koishi",
"description": "跨平台机器人框架",
"start_url": "/index.html",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#5546a3",
"icons": [
{
"src": "/koishi.png",
"sizes": "384x384",
"type": "image/png"
}
]
}
6 changes: 6 additions & 0 deletions docs/.vuepress/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ module.exports = {
['medium-zoom', {
selector: '.theme-default-content :not(a) > img:not(.no-zooming)',
}],
['@vuepress/pwa', {
skipWaiting: true,
}]
['@vuepress/docsearch', {
apiKey: '24a872e49e34cdb7736d132917a308c6',
indexName: 'koishi',
searchParameters: {
facetFilters: ['tags:latest'],
},
}],
['@vuepress/container', {
type: 'code-group',
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"devDependencies": {
"@vuepress/plugin-docsearch": "^2.0.0-beta.12",
"@vuepress/plugin-pwa": "^2.0.0-beta.12",
"@vuepress/plugin-register-components": "^2.0.0-beta.12",
"diacritics": "^1.3.0",
"shiki": "^0.9.3",
Expand Down

0 comments on commit 3cd2303

Please sign in to comment.