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:
@@ -62,6 +62,12 @@ A share link will be automatically generated after successful upload
|
||||

|
||||
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -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
16
main.ts
@@ -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();
|
||||
})
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user