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 performance optimizations #3316

Merged
merged 7 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
32 changes: 15 additions & 17 deletions packages/docs/components/landing/StarsButton.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<template>
<client-only>
<va-button
:href="url"
size="small"
target="blank"
color="textPrimary"
class="stars-button"
>
<template #prepend>
<va-icon
name="star_empty"
size="small"
/>
</template>
{{ stars }}
</va-button>
</client-only>
<va-button
:href="url"
size="small"
target="blank"
color="textPrimary"
class="stars-button"
>
<template #prepend>
<va-icon
name="star_empty"
size="small"
/>
</template>
{{ stars }}
</va-button>
</template>

<script lang="ts">
Expand Down
35 changes: 22 additions & 13 deletions packages/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ export default defineNuxtConfig({
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'icon', type: 'image/png', href: '/favicon.png' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' },
{ rel: 'stylesheet', href: "https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700&display=swap" },
{ rel: 'stylesheet', href: "https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400&display=swap" },
{ rel: 'stylesheet', href: "https://fonts.googleapis.com/icon?family=Material+Icons&display=swap" },
{ rel: 'stylesheet', href: "https://fonts.googleapis.com/icon?family=Material+Icons+Outlined&display=swap" },
{ rel: 'dns-prefetch', as: 'script', href: 'https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js' },
rustem-nasyrov marked this conversation as resolved.
Show resolved Hide resolved
{ rel: 'dns-prefetch', as: 'script', href: 'https://kit.fontawesome.com/5460c87b2a.js' },
],

script: [
Expand Down Expand Up @@ -76,21 +73,18 @@ export default defineNuxtConfig({
},
},

// TODO: hydration mismatch issues; tailwind doesn't work properly
// ssr: false,
// nitro: {
// prerender: {
// routes: ['/'],
// ignore: ['/*']
// }
// },
ssr: true,
nitro: {
compressPublicAssets: true,
},

modules: [
// './modules/banner',
'./modules/vuestic',
'./modules/page-config',
// "./modules/i18n",
// TODO: remove after i18n is released https://github.com/nuxt-modules/i18n/pull/1712
'@nuxtjs/google-fonts',
'@nuxtjs/i18n-edge',
'./modules/markdown',
'@nuxtjs/tailwindcss',
Expand All @@ -102,6 +96,21 @@ export default defineNuxtConfig({
fonts: false,
},

googleFonts: {
preload: true,
swap: true,
families: {
'Source+Sans+Pro': {
wght: [400, 600, 700],
},
'Source+Code+Pro': {
wght: [400],
},
'Material+Icons': true,
'Material+Icons+Outlined': true,
},
},

tailwindcss: {
config: {
content: [
Expand Down
5 changes: 3 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
},
"dependencies": {
"@docsearch/js": "^3.2.1",
"@nuxtjs/google-fonts": "^3.0.0-1",
"@types/acorn": "^6.0.0",
"acorn": "^8.8.1",
"codesandbox": "^2.2.3",
"highlight.js": "^11.7.0",
"markdown-it": "^12.3.2",
"markdown-it-attrs": "^4.0.0",
"highlight.js": "^11.7.0"
"markdown-it-attrs": "^4.0.0"
}
}
Loading