Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): new theme #304

Merged
merged 46 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a86dc1e
docs: new theme
userquin Jun 7, 2022
24101ec
Merge branch 'main' into userquin/feat-new-theme
userquin Jun 7, 2022
97b33c2
chore: update
antfu Jun 7, 2022
3360cb1
chore: cleanup deependencies
userquin Jun 8, 2022
64bdca6
chore: remove aria-hidden from pwa-prompt
userquin Jun 8, 2022
fd4a1f6
chore: use teloport on pwa-prompt
userquin Jun 8, 2022
0bff649
chore: update deployment index page
userquin Jun 8, 2022
af69b65
chore: update vitepress
userquin Jun 15, 2022
339a031
chore: add vitepress docs preview script
userquin Jun 15, 2022
2e20365
chore: remove postcss from prompt component
userquin Jun 15, 2022
6814c7c
fix: patch VitePress Layout adding slots
userquin Jun 16, 2022
4d169a9
chore: add bg transparent to code blocks inside warnings
userquin Jun 16, 2022
a73d26f
chore: remove development from workbox configuration
userquin Jun 16, 2022
4f5671c
chore: enable optimize page on build script
userquin Jun 16, 2022
0249f9f
chore: add release notes (changelog enabled on repo)
userquin Jun 17, 2022
9f476cd
chore: change discord link
userquin Jun 17, 2022
1d44576
chore: prepare algolia config
userquin Jun 17, 2022
411f9ec
chore: add exclude routes from sw interception
userquin Jun 17, 2022
4cec9a0
chore: change title for deployment => deploy
userquin Jun 17, 2022
fee7fd7
chore: change navbar items
userquin Jun 17, 2022
c4d0584
chore: move plugins
userquin Jun 17, 2022
74f32fe
chore: add exclude routes link on faq
userquin Jun 17, 2022
5adc213
chore: add VitePress on window undefined on faq
userquin Jun 17, 2022
a13e24d
chore: prepare sample for VitePress bug
userquin Jun 18, 2022
98b8b0f
chore: revert test for VitePress bug
userquin Jun 18, 2022
42115eb
chore: fix some wording
userquin Jun 18, 2022
1dfd80e
chore: wording
userquin Jun 18, 2022
fc7b06f
chore(guide-index): fix `masked-icon` extension on `includeAssets`
userquin Jun 18, 2022
4d078f4
chore: update theme components
userquin Jun 19, 2022
8bcbaaf
fix: remove dead links
userquin Jun 19, 2022
21f8b8a
chore: update custom service worker intro on inject manifest
userquin Jun 19, 2022
72bc00e
chore: update backticks code style
userquin Jun 19, 2022
d6acb96
chore: cleanup development
userquin Jun 20, 2022
07278bb
chore: exclude VitePress hashmap.json file from sw manifest
userquin Jun 20, 2022
2ca9ccd
chore: include example to fix `injectRegister` bug on guide index
userquin Jun 20, 2022
0d7784e
chore: refactor `injectRegister` bug fix warning
userquin Jun 20, 2022
7e9bd73
chore: add some links to `vite-plugin-pwa` entry on index guide
userquin Jun 20, 2022
f97aefd
chore: fix link on `vite-plugin-pwa` section on index guide
userquin Jun 20, 2022
e40744f
chore: add `injectRegister` as optional and how to configure it
userquin Jun 20, 2022
cd901a8
chore: add sw location configuration options on `injectManifest`
userquin Jun 20, 2022
d08f321
feat: algolia
antfu Jun 21, 2022
782c6aa
chore: add sw location configuration options on `injectManifest`
userquin Jun 22, 2022
a9b784e
chore: remove fix layout, update VitePress to alpha.4
userquin Jun 22, 2022
062f178
chore: add collapsible sidebar
userquin Jun 24, 2022
683d0fd
chore: update logo
antfu Jun 30, 2022
f876cae
fix: update algolia
antfu Jun 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/.vitepress/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
import '@vue/runtime-core'

declare module '@vue/runtime-core' {
export interface GlobalComponents {
CleanupOutdatedCaches: typeof import('./theme/components/CleanupOutdatedCaches.md')['default']
ExamplesBehaviors: typeof import('./theme/components/ExamplesBehaviors.md')['default']
ExamplesGenerateSW: typeof import('./theme/components/ExamplesGenerateSW.md')['default']
ExamplesInjectManifest: typeof import('./theme/components/ExamplesInjectManifest.md')['default']
GenerateSWCleanupOutdatedCaches: typeof import('./theme/components/GenerateSWCleanupOutdatedCaches.md')['default']
GenerateSWSourceMap: typeof import('./theme/components/GenerateSWSourceMap.md')['default']
HeuristicWorkboxWindow: typeof import('./theme/components/HeuristicWorkboxWindow.md')['default']
InjectManifestCleanupOutdatedCaches: typeof import('./theme/components/InjectManifestCleanupOutdatedCaches.md')['default']
InjectManifestSourceMap: typeof import('./theme/components/InjectManifestSourceMap.md')['default']
PromptForUpdateImg: typeof import('./theme/components/PromptForUpdateImg.vue')['default']
ReloadPrompt: typeof import('./theme/components/ReloadPrompt.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
RunExamples: typeof import('./theme/components/RunExamples.md')['default']
SsrSsg: typeof import('./theme/components/SsrSsg.md')['default']
}
}

export {}
224 changes: 139 additions & 85 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
import type { UserConfig } from 'vitepress'
import { defineConfig } from 'vitepress'
import { version } from '../../package.json'

const Guide = [
{
text: 'Getting Started',
link: '/guide/',
},
{
text: 'Generate Service Worker',
link: '/guide/generate',
text: 'Register Service Worker',
link: '/guide/register-service-worker',
},
{
text: 'Prompt for update',
link: '/guide/prompt-for-update',
text: 'Service Worker Precache',
link: '/guide/service-worker-precache',
},
{
text: 'PWA Minimal Requirements',
link: '/guide/pwa-minimal-requirements',
},
{
text: 'Service Worker Strategies And Behaviors',
link: '/guide/service-worker-strategies-and-behaviors',
},
{
text: 'Automatic reload',
link: '/guide/auto-update',
},
{
text: 'Prompt for update',
link: '/guide/prompt-for-update',
},
{
text: 'Advanced (injectManifest)',
link: '/guide/inject-manifest',
Expand All @@ -33,10 +46,6 @@ const Guide = [
text: 'Development',
link: '/guide/development',
},
{
text: 'Testing Service Worker',
link: '/guide/testing',
},
{
text: 'FAQ',
link: '/guide/faq',
Expand Down Expand Up @@ -103,6 +112,14 @@ const Frameworks = [
text: 'VitePress',
link: '/frameworks/vitepress',
},
{
text: 'îles',
link: '/frameworks/iles',
},
{
text: 'Astro (WIP)',
link: '/frameworks/astro',
},
]

const Examples = [
Expand Down Expand Up @@ -138,6 +155,14 @@ const Examples = [
text: 'VitePress',
link: '/examples/vitepress',
},
{
text: 'îles',
link: '/examples/iles',
},
{
text: 'Astro (WIP)',
link: '/examples/astro',
},
]

const Workbox = [
Expand All @@ -155,109 +180,138 @@ const Workbox = [
},
]

const slidebars = [
{
text: 'Guide',
children: Guide.map((e) => {
(e as any).useLinkText = `${e.text} | Guide`
return e
}),
},
{
text: 'Frameworks',
children: Frameworks.map((e) => {
(e as any).useLinkText = `${e.text} | Frameworks`
return e
}),
},
{
text: 'Examples',
children: Examples.map((e) => {
(e as any).useLinkText = `${e.text} | Examples`
return e
}),
},
{
text: 'Deployment',
children: Deployment.map((e) => {
(e as any).useLinkText = `${e.text} | Deployment`
return e
}),
},
{
text: 'Workbox',
children: Workbox.map((e) => {
(e as any).useLinkText = `${e.text} | Workbox`
return e
}),
},
]
function prepareSidebar(idx: number) {
return [
{
text: 'Guide',
collapsible: true,
collapsed: true,
items: Guide,
},
{
text: 'Frameworks',
collapsible: true,
collapsed: true,
items: Frameworks,
},
{
text: 'Examples',
collapsible: true,
collapsed: true,
items: Examples,
},
{
text: 'Deploy',
collapsible: true,
collapsed: true,
items: Deployment,
},
{
text: 'Workbox',
collapsible: true,
collapsed: true,
items: Workbox,
},
].map((entry, i) => {
if (idx === i)
entry.collapsed = false

return entry
})
}

const config: UserConfig = {
export default defineConfig({
lang: 'en-US',
title: 'Vite Plugin PWA',
description: 'Zero-config PWA Framework-agnostic Plugin for Vite',
lang: 'en-US',
head: [
['meta', { name: 'theme-color', content: '#ffffff' }],
['link', { rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml' }],
['link', { rel: 'alternate icon', href: '/favicon.ico', type: 'image/png', sizes: '16x16' }],
['link', { rel: 'mask-icon', href: '/safari-pinned-tab.svg', color: '#ffffff' }],
['meta', { name: 'author', content: 'Anthony Fu' }],
['meta', { name: 'keywords', content: 'react, pwa, vue, vitepress, preact, svelte, sveltekit, workbox, solidjs, vite, vite-plugin' }],
['meta', {
name: 'keywords',
content: 'PWA, React, Vue, VitePress, Preact, Svelte, SvelteKit, workbox, SolidJS, Vite, vite-plugin, îles, Astro',
}],
['meta', { property: 'og:title', content: 'Vite Plugin PWA' }],
['meta', { property: 'og:description', content: 'Zero-config PWA Framework-agnostic Plugin for Vite' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:creator', content: '@antfu7' }],
['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' }],
],
lastUpdated: true,
markdown: {
theme: {
light: 'vitesse-light',
dark: 'vitesse-dark',
},
},
themeConfig: {
logo: '/favicon.svg',
repo: 'antfu/vite-plugin-pwa',
docsDir: 'docs',
editLinks: true,
editLinkText: 'Edit this page',
lastUpdated: 'Last Updated',
/*
algolia: {
apiKey: 'todo@antfu: replace this',
indexName: 'vite-plugin-pwa',
searchParameters: {
// for translations maintainers: change the filter to your locale code (subdomain name)
facetFilters: ['language:en']
}
},
*/
// logo: '/favicon.svg',
editLink: {
pattern: 'https://github.com/antfu/vite-plugin-pwa/edit/main/docs/:path',
text: 'Suggest changes to this page',
},
algolia: {
appId: 'TTO9T0AE3F',
apiKey: '71bd3d3c7274205843267bb1ccb6b1a8',
indexName: 'vite-plugin-pwa',
},
socialLinks: [
{ icon: 'discord', link: 'https://chat.antfu.me' },
{ icon: 'github', link: 'https://github.com/antfu/vite-plugin-pwa' },
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2021-PRESENT Anthony Fu',
},
nav: [
{
text: 'Guide',
items: Guide,
items: [
{
text: 'Getting Started',
link: '/guide/',
},
{
text: 'Frameworks',
link: '/frameworks/',
},
{
text: 'Examples',
link: '/examples/',
},
],
},
{
text: 'Frameworks',
items: Frameworks,
text: 'Deploy',
link: '/deployment/',
},
{
text: 'Examples',
items: Examples,
},
{
text: 'Deployment',
items: Deployment,
text: 'Workbox',
link: '/workbox/',
},
{
text: 'Workbox',
items: Workbox,
text: `v${version}`,
items: [
{
text: 'Release Notes',
link: 'https://github.com/antfu/vite-plugin-pwa/releases',
},
{
text: 'Contributing',
link: 'https://github.com/antfu/vite-plugin-pwa/blob/main/CONTRIBUTING.md',
},
],
},
],
sidebar: {
'/guide/': slidebars,
'/frameworks/': slidebars,
'/examples/': slidebars,
'/deployment/': slidebars,
'/workbox/': slidebars,
'/': slidebars,
'/guide/': prepareSidebar(0),
'/frameworks/': prepareSidebar(1),
'/examples/': prepareSidebar(2),
'/deployment/': prepareSidebar(3),
'/workbox/': prepareSidebar(4),
},
},
}

export default config
})
Loading