Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Jan 2, 2024
2 parents f5a2d98 + 85bc860 commit ca1cb2b
Show file tree
Hide file tree
Showing 13 changed files with 1,128 additions and 606 deletions.
26 changes: 26 additions & 0 deletions docs/content/1.setup/2.ssr/0.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,32 @@ export interface SSRHeadPayload {
}
```

### Options

When using `renderSSRHead`, you can pass an optional `options` object to customize the output.

```ts
export interface RenderSSRHeadOptions {
omitLineBreaks?: boolean
}
```

#### omitLineBreaks

- Type: `boolean`
- Default: `false`

Set `omitLineBreaks` to `true` if you prefer to render the head tags without line breaks.

Example usage:

```ts
const options = { omitLineBreaks: true }
const payload = await renderSSRHead(head, options)
```

This will render the head tags as a single line, omitting any line breaks that would normally be included.

## 2. Update your app template

You will need to update your app template to add in the templates for
Expand Down
8 changes: 4 additions & 4 deletions docs/content/1.usage/2.composables/4.use-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const { gtag } = useScript<GoogleTag>({
src: 'https://www.google-analytics.com/analytics.js',
}, {
trigger: 'idle',
use: () => { gtag: window.gtag },
use: () => ({ gtag: window.gtag }),
})
// fully typed, usable in SSR and when lazy loaded
gtag('event', 'page_view', {
Expand All @@ -76,7 +76,7 @@ We can even go a step further, say we want to send API requests on the server, w
const { gtag } = useScript<GoogleTag>({
src: 'https://www.google-analytics.com/analytics.js',
}, {
use: () => { gtag: window.gtag },
use: () => ({ gtag: window.gtag }),
stub: () => {
if (process.server) {
return (fn: 'event', opt: string, opt2: { [key: string]: string }) => {
Expand Down Expand Up @@ -231,7 +231,7 @@ import { useScript } from 'unhead'
const { gtag } = useScript({
src: 'https://www.google-analytics.com/analytics.js',
}, {
use: () => { gtag: window.gtag }
use: () => ({ gtag: window.gtag })
})
```

Expand All @@ -242,7 +242,7 @@ import { useScript } from '@unhead/vue'
const { gtag } = useScript({
src: 'https://www.google-analytics.com/analytics.js',
}, {
use: () => { gtag: window.gtag }
use: () => ({ gtag: window.gtag })
})
</script>
```
Expand Down
20 changes: 10 additions & 10 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
"preview": "nuxi preview"
},
"devDependencies": {
"@iconify-json/heroicons": "^1.1.15",
"@iconify-json/noto": "^1.1.17",
"@iconify-json/ph": "^1.1.8",
"@iconify-json/simple-icons": "^1.1.82",
"@iconify-json/heroicons": "^1.1.16",
"@iconify-json/noto": "^1.1.18",
"@iconify-json/ph": "^1.1.9",
"@iconify-json/simple-icons": "^1.1.84",
"@nuxt/content": "^2.9.0",
"@nuxt/devtools": "^1.0.5",
"@nuxt/ui": "2.11.0",
"@nuxt/ui-pro": "0.5.0",
"@nuxt/devtools": "^1.0.6",
"@nuxt/ui": "2.11.1",
"@nuxt/ui-pro": "0.6.1",
"@nuxtjs/fontaine": "^0.4.1",
"@nuxtseo/module": "2.0.0-beta.45",
"@nuxtseo/module": "2.0.0-beta.50",
"@vueuse/nuxt": "^10.7.0",
"nuxt": "3.8.2",
"nuxt-icon": "^0.6.7",
"nuxt-lego": "^0.0.14",
"nuxt-lodash": "^2.5.3",
"nuxt-og-image": "3.0.0-beta.57"
"nuxt-og-image": "3.0.0-rc.10"
},
"resolutions": {
"nuxt-og-image": "3.0.0-beta.56"
"nuxt-og-image": "3.0.0-rc.10"
}
}
Loading

0 comments on commit ca1cb2b

Please sign in to comment.