You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`%separator`| The separator, defaults to a pipe character \|. |
117
-
118
-
The `%separator` token is smart - it only appears between content and automatically removes itself when the title is empty or when multiple separators would appear.
119
-
120
-
Define custom template params to maintain consistent formatting:
121
-
122
-
::code-group
123
-
124
-
```ts twoslash [input.vue]
111
+
::code-block
112
+
```ts [Input]
125
113
useHead({
126
114
title: 'Home',
127
115
titleTemplate: '%s %separator %siteName',
128
116
templateParams: {
129
-
seperator: '—',
130
-
siteName: 'MySite'
117
+
separator: '·',
118
+
siteName: 'My Site'
131
119
}
132
120
})
133
121
```
134
122
135
-
```html [output.html]
136
-
<head>
137
-
<title>Home — MySite</title>
138
-
</head>
123
+
```html [Output]
124
+
<title>Home · My Site</title>
139
125
```
140
-
141
126
::
142
127
143
-
I'd suggest choosing your own separator as the `'|'` is a bit ugly in my opinion, you can try:
144
-
145
-
```ts
146
-
typeSeperator='-'|'—'|'•'|'·'|'❤️'
147
-
```
148
-
149
-
You can use template params in other head tags too, such as meta descriptions and open graph tags.
150
-
151
-
```ts
152
-
useHead({
153
-
templateParams: {
154
-
siteName:'MyApp'
155
-
},
156
-
title:'Home',
157
-
meta: [
158
-
{ name:'description', content:'Welcome to %siteName - where we make awesome happen' },
0 commit comments