File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,11 @@ export class PropertiesParser {
35
35
throw this . errorMissingRequiredProperty ( "of type 'title'" , page ) ;
36
36
}
37
37
38
- if ( ! category ) {
38
+ const theCategory = category || config . pages . frontmatter . category . static ;
39
+
40
+ if ( ! theCategory ) {
39
41
throw this . errorMissingRequiredProperty (
40
- config . pages . frontmatter . category . property ,
42
+ config . pages . frontmatter . category . property || "static category" ,
41
43
page
42
44
) ;
43
45
}
@@ -47,7 +49,7 @@ export class PropertiesParser {
47
49
id : page . id ,
48
50
url : page . url ,
49
51
title : title , // notion API always calls it name
50
- category : category ,
52
+ category : theCategory ,
51
53
order : order ,
52
54
...config . pages . frontmatter . extra ,
53
55
} ,
Original file line number Diff line number Diff line change @@ -73,8 +73,6 @@ export interface DatabaseConfigRenderTable extends DatabaseConfigBase {
73
73
*/
74
74
emitToIndex : boolean ;
75
75
} ;
76
-
77
-
78
76
}
79
77
80
78
export interface DatabaseConfigRenderPages extends DatabaseConfigBase {
@@ -90,8 +88,13 @@ export interface DatabaseConfigRenderPages extends DatabaseConfigBase {
90
88
*
91
89
* Example: "Cluster"
92
90
*/
93
- property : string ;
91
+ property ?: string ;
92
+ /**
93
+ * A static category value to assign to every page
94
+ */
95
+ static ?: string ;
94
96
} ;
97
+
95
98
extra ?: Record < string , any > ;
96
99
} ;
97
100
} ;
You can’t perform that action at this time.
0 commit comments