File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,16 @@ func (o *Archiver) Operate(item *cubox.Item) error {
23
23
}
24
24
25
25
func (o * Archiver ) createNewPage (item * cubox.Item ) (* notionapi.Page , error ) {
26
+ nameText := notionapi.RichText {
27
+ Text : & notionapi.Text {Content : item .Title },
28
+ }
29
+ if item .TargetURL != "" {
30
+ nameText .Text .Link = & notionapi.Link {Url : item .TargetURL }
31
+ }
26
32
properties := map [string ]notionapi.Property {
27
33
// todo 把这里的属性名换成常量,在创建数据库的时候也要用到
28
34
"Name" : notionapi.TitleProperty {
29
- Title : []notionapi.RichText {
30
- {
31
- Text : & notionapi.Text {Content : item .Title , Link : & notionapi.Link {Url : item .TargetURL }},
32
- },
33
- },
35
+ Title : []notionapi.RichText {nameText },
34
36
},
35
37
"CuboxID" : notionapi.RichTextProperty {
36
38
RichText : []notionapi.RichText {
You can’t perform that action at this time.
0 commit comments