Added custom banner url

This commit is contained in:
chris
2022-05-24 18:00:44 +08:00
parent c9a5c72c6c
commit 27c8e0f610
3 changed files with 28 additions and 0 deletions

View File

@@ -62,6 +62,12 @@ A share link will be automatically generated after successful upload
![](./doc/5.png)
# Todo
- [ ] support for mobile
- [x] support for custom page banner
- [ ] update the exsit page
# Buy me a cup of coffee.
[Buy me a coffee](https://dun.mianbaoduo.com/@easy)

View File

@@ -18,6 +18,12 @@ export class Upload2Notion {
parent: {
database_id: this.app.settings.databaseID
},
cover: {
type: "external",
external: {
url: this.app.settings.bannerUrl
}
},
properties: {
Name: {
title: [

16
main.ts
View File

@@ -22,12 +22,14 @@ import { Upload2Notion } from "Upload2Notion";
interface MyPluginSettings {
notionAPI: string;
databaseID: string;
bannerUrl: string;
proxy: string;
}
const DEFAULT_SETTINGS: MyPluginSettings = {
notionAPI: "",
databaseID: "",
bannerUrl: "",
proxy: "",
};
@@ -185,6 +187,20 @@ class SampleSettingTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);
new Setting(containerEl)
.setName("Banner Url")
.setDesc("page banner url")
.addText((text) =>
text
.setPlaceholder("Enter banner pic url: ")
.setValue(this.plugin.settings.bannerUrl)
.onChange(async (value) => {
console.log("Secret: " + value);
this.plugin.settings.bannerUrl = value;
await this.plugin.saveSettings();
})
);
}
}