File tree Expand file tree Collapse file tree 6 files changed +64
-58
lines changed Expand file tree Collapse file tree 6 files changed +64
-58
lines changed Original file line number Diff line number Diff line change
1
+ declare module 'nuxt/schema' {
2
+ interface AppConfig {
3
+ seo : {
4
+ titleTemplate : string
5
+ title : string
6
+ description : string
7
+ }
8
+ header : {
9
+ title : string
10
+ logo : {
11
+ light : string
12
+ dark : string
13
+ alt : string
14
+ }
15
+ }
16
+ socials : Record < string , string >
17
+ toc : {
18
+ title : string
19
+ bottom : {
20
+ title : string
21
+ links : {
22
+ icon : string
23
+ label : string
24
+ to : string
25
+ target : string
26
+ } [ ]
27
+ }
28
+ }
29
+ github : {
30
+ owner : string
31
+ name : string
32
+ url : string
33
+ branch : string
34
+ rootDir ?: string
35
+ }
36
+ }
37
+ }
38
+
39
+ export { }
Original file line number Diff line number Diff line change @@ -29,8 +29,10 @@ export function getGitBranch() {
29
29
}
30
30
}
31
31
catch {
32
- return 'main'
32
+ // Ignore error
33
33
}
34
+
35
+ return 'main'
34
36
}
35
37
36
38
export async function getLocalGitInfo ( rootDir : string ) : Promise < GitInfo | undefined > {
@@ -63,7 +65,7 @@ async function getLocalGitRemote(dir: string): Promise<string | undefined> {
63
65
}
64
66
}
65
67
66
- export function getGitEnv ( ) : GitInfo | undefined {
68
+ export function getGitEnv ( ) : GitInfo {
67
69
// https://github.com/unjs/std-env/issues/59
68
70
const envInfo = {
69
71
// Provider
Original file line number Diff line number Diff line change @@ -30,22 +30,25 @@ export default defineNuxtModule({
30
30
debug : false ,
31
31
} )
32
32
33
- nuxt . options . appConfig = defu ( nuxt . options . appConfig , {
34
- header : {
35
- title : siteName ,
36
- } ,
37
- github : {
38
- owner : gitInfo ?. owner ,
39
- name : gitInfo ?. name ,
40
- url : gitInfo ?. url ,
41
- branch : getGitBranch ( ) ,
42
- } ,
43
- seo : {
44
- titleTemplate : `%s - ${ siteName } ` ,
45
- title : siteName ,
46
- description : meta . description || '' ,
47
- } ,
48
- toc : { } ,
33
+ nuxt . options . appConfig . header = defu ( nuxt . options . appConfig . header , {
34
+ title : siteName ,
35
+ } )
36
+
37
+ nuxt . options . appConfig . seo = defu ( nuxt . options . appConfig . seo , {
38
+ titleTemplate : `%s - ${ siteName } ` ,
39
+ title : siteName ,
40
+ description : meta . description || '' ,
41
+ } )
42
+
43
+ nuxt . options . appConfig . github = defu ( nuxt . options . appConfig . github , {
44
+ owner : gitInfo ?. owner ,
45
+ name : gitInfo ?. name ,
46
+ url : gitInfo ?. url ,
47
+ branch : getGitBranch ( ) ,
48
+ } )
49
+
50
+ nuxt . options . appConfig . toc = defu ( nuxt . options . appConfig . toc , {
51
+ title : 'On this page' ,
49
52
} )
50
53
} ,
51
54
} )
Original file line number Diff line number Diff line change @@ -216,41 +216,3 @@ export default defineNuxtSchema({
216
216
} ) ,
217
217
} ,
218
218
} )
219
-
220
- declare module '@nuxt/schema' {
221
- interface AppConfig {
222
- seo : {
223
- titleTemplate : string
224
- title : string
225
- description : string
226
- }
227
- header : {
228
- title : string
229
- logo : {
230
- light : string
231
- dark : string
232
- alt : string
233
- }
234
- }
235
- socials : Record < string , string >
236
- toc : {
237
- title : string
238
- bottom : {
239
- title : string
240
- links : {
241
- icon : string
242
- label : string
243
- to : string
244
- target : string
245
- } [ ]
246
- }
247
- }
248
- github : {
249
- owner : string
250
- name : string
251
- url : string
252
- branch : string
253
- rootDir ?: string
254
- }
255
- }
256
- }
Original file line number Diff line number Diff line change 1
1
{
2
2
"extends" : " ./.nuxt/tsconfig.json"
3
- }
3
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"extends" : " ./.nuxt/tsconfig.json"
3
- }
3
+ }
You can’t perform that action at this time.
0 commit comments