|
1 | 1 | import { defineConfig } from "vitepress"; |
| 2 | +import { withPwa } from "@vite-pwa/vitepress"; |
2 | 3 |
|
3 | 4 | // https://vitepress.dev/reference/site-config |
4 | | -export default defineConfig({ |
5 | | - title: "{{ cookiecutter.project_name }}", |
6 | | - description: "{{ cookiecutter.project_description }}", |
7 | | - themeConfig: { |
8 | | - // https://vitepress.dev/reference/default-theme-config |
9 | | - logo: "/logo.png", |
10 | | - nav: [ |
11 | | - { text: "Home", link: "/" }, |
12 | | - { text: "Guide", link: "/guide/" }, |
13 | | - { text: "API", link: "/api/" }, |
14 | | - { |
15 | | - text: "GitHub", |
16 | | - link: "https://github.com/{{ cookiecutter.github_name }}/{{ cookiecutter.project_name }}", |
| 5 | +export default withPwa( |
| 6 | + defineConfig({ |
| 7 | + title: "{{ cookiecutter.project_name }}", |
| 8 | + description: "{{ cookiecutter.project_description }}", |
| 9 | + themeConfig: { |
| 10 | + // https://vitepress.dev/reference/default-theme-config |
| 11 | + logo: "/logo.png", |
| 12 | + nav: [ |
| 13 | + { text: "Home", link: "/" }, |
| 14 | + { text: "Guide", link: "/guide/" }, |
| 15 | + { text: "API", link: "/api/" }, |
| 16 | + { |
| 17 | + text: "GitHub", |
| 18 | + link: "https://github.com/{{ cookiecutter.github_name }}/{{ cookiecutter.project_name }}", |
| 19 | + }, |
| 20 | + ], |
| 21 | + sidebar: [ |
| 22 | + { |
| 23 | + text: "Introduction", |
| 24 | + items: [ |
| 25 | + { text: "Getting Started", link: "/guide/" }, |
| 26 | + { text: "Installation", link: "/guide/installation" }, |
| 27 | + ], |
| 28 | + }, |
| 29 | + { |
| 30 | + text: "API Reference", |
| 31 | + items: [ |
| 32 | + { text: "Overview", link: "/api/" }, |
| 33 | + { text: "Examples", link: "/api/examples" }, |
| 34 | + ], |
| 35 | + }, |
| 36 | + ], |
| 37 | + socialLinks: [ |
| 38 | + { |
| 39 | + icon: "github", |
| 40 | + link: "https://github.com/{{ cookiecutter.github_name }}/{{ cookiecutter.project_name }}", |
| 41 | + }, |
| 42 | + ], |
| 43 | + footer: { |
| 44 | + message: "Released under the {{ cookiecutter.license }} License.", |
| 45 | + copyright: |
| 46 | + 'Copyright © {% now "utc", "%Y" %} {{ cookiecutter.organization }}', |
17 | 47 | }, |
18 | | - ], |
19 | | - sidebar: [ |
20 | | - { |
21 | | - text: "Introduction", |
22 | | - items: [ |
23 | | - { text: "Getting Started", link: "/guide/" }, |
24 | | - { text: "Installation", link: "/guide/installation" }, |
25 | | - ], |
26 | | - }, |
27 | | - { |
28 | | - text: "API Reference", |
29 | | - items: [ |
30 | | - { text: "Overview", link: "/api/" }, |
31 | | - { text: "Examples", link: "/api/examples" }, |
| 48 | + }, |
| 49 | + pwa: { |
| 50 | + manifest: { |
| 51 | + name: "{{ cookiecutter.project_name }}", |
| 52 | + short_name: "{{ cookiecutter.project_name }}", |
| 53 | + theme_color: "#2b2a27", |
| 54 | + background_color: "#ffffff", |
| 55 | + display: "standalone", |
| 56 | + orientation: "portrait", |
| 57 | + scope: "/", |
| 58 | + start_url: "/", |
| 59 | + icons: [ |
| 60 | + { |
| 61 | + src: "/logo.png", |
| 62 | + sizes: "192x192", |
| 63 | + type: "image/png", |
| 64 | + purpose: "maskable any", |
| 65 | + }, |
32 | 66 | ], |
33 | 67 | }, |
34 | | - ], |
35 | | - socialLinks: [ |
36 | | - { |
37 | | - icon: "github", |
38 | | - link: "https://github.com/{{ cookiecutter.github_name }}/{{ cookiecutter.project_name }}", |
39 | | - }, |
40 | | - ], |
41 | | - footer: { |
42 | | - message: "Released under the {{ cookiecutter.license }} License.", |
43 | | - copyright: |
44 | | - 'Copyright © {% now "utc", "%Y" %} {{ cookiecutter.organization }}', |
45 | 68 | }, |
46 | | - }, |
47 | | -}); |
| 69 | + }) |
| 70 | +); |
0 commit comments