Skip to content

Commit f8d5517

Browse files
committed
add git attributes and publish load script
1 parent 2a32554 commit f8d5517

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Publish.js linguist-generated

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ node_modules
1111
# Don't include the compiled main.js file in the repo.
1212
# They should be uploaded to GitHub releases instead.
1313
main.js
14-
PublishLoad.js
1514

1615
# Exclude sourcemaps
1716
*.map

PublishLoad.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// META-BIND OBSIDIAN PUBLISH SCRIPT
2+
// add this script to the end of you publish.js
3+
// this script loads and executes the latest version of the meta-bind plugin for obsidian publish
4+
5+
// The plugin settings. Not all settings are used.
6+
let mb_settingsString = `{
7+
"devMode": false,
8+
"preferredDateFormat": "YYYY-MM-DD",
9+
"useUsDateInputOrder": false,
10+
"syncInterval": 50,
11+
"minSyncInterval": 1000,
12+
"maxSyncInterval": 50,
13+
"inputTemplates": "",
14+
"dateFormat": "eu"
15+
}`;
16+
17+
// if true, the script is pulled from the master branch instead of the release branch
18+
const mb_dev_mode = false;
19+
20+
const mb_settings = JSON.parse(mb_settingsString);
21+
22+
async function mb_load() {
23+
const response = mb_dev_mode
24+
? await fetch('https://raw.githubusercontent.com/mProjectsCode/obsidian-meta-bind-plugin/master/Publish.js')
25+
: await fetch('https://raw.githubusercontent.com/mProjectsCode/obsidian-meta-bind-plugin/release/Publish.js');
26+
const script = await response.text();
27+
eval(script);
28+
}
29+
30+
await mb_load();

0 commit comments

Comments
 (0)