mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
Added custom banner url
This commit is contained in:
@@ -14,16 +14,10 @@ export class Upload2Notion {
|
|||||||
this.app = app;
|
this.app = app;
|
||||||
}
|
}
|
||||||
async createPage(title:string, childArr: any) {
|
async createPage(title:string, childArr: any) {
|
||||||
const bodyString = {
|
const bodyString:any = {
|
||||||
parent: {
|
parent: {
|
||||||
database_id: this.app.settings.databaseID
|
database_id: this.app.settings.databaseID
|
||||||
},
|
},
|
||||||
cover: {
|
|
||||||
type: "external",
|
|
||||||
external: {
|
|
||||||
url: this.app.settings.bannerUrl
|
|
||||||
}
|
|
||||||
},
|
|
||||||
properties: {
|
properties: {
|
||||||
Name: {
|
Name: {
|
||||||
title: [
|
title: [
|
||||||
@@ -37,6 +31,16 @@ export class Upload2Notion {
|
|||||||
},
|
},
|
||||||
children: childArr,
|
children: childArr,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.app.settings.bannerUrl) {
|
||||||
|
bodyString.cover = {
|
||||||
|
type: "external",
|
||||||
|
external: {
|
||||||
|
url: this.app.settings.bannerUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const response = await requestUrl({
|
const response = await requestUrl({
|
||||||
url: `https://api.notion.com/v1/pages`,
|
url: `https://api.notion.com/v1/pages`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user