Skip to content

Commit

Permalink
add git attributes and publish load script
Browse files Browse the repository at this point in the history
  • Loading branch information
mProjectsCode committed Jun 14, 2023
1 parent 2a32554 commit f8d5517
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Publish.js linguist-generated
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ node_modules
# Don't include the compiled main.js file in the repo.
# They should be uploaded to GitHub releases instead.
main.js
PublishLoad.js

# Exclude sourcemaps
*.map
Expand Down
30 changes: 30 additions & 0 deletions PublishLoad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// META-BIND OBSIDIAN PUBLISH SCRIPT
// add this script to the end of you publish.js
// this script loads and executes the latest version of the meta-bind plugin for obsidian publish

// The plugin settings. Not all settings are used.
let mb_settingsString = `{
"devMode": false,
"preferredDateFormat": "YYYY-MM-DD",
"useUsDateInputOrder": false,
"syncInterval": 50,
"minSyncInterval": 1000,
"maxSyncInterval": 50,
"inputTemplates": "",
"dateFormat": "eu"
}`;

// if true, the script is pulled from the master branch instead of the release branch
const mb_dev_mode = false;

const mb_settings = JSON.parse(mb_settingsString);

async function mb_load() {
const response = mb_dev_mode
? await fetch('https://raw.githubusercontent.com/mProjectsCode/obsidian-meta-bind-plugin/master/Publish.js')
: await fetch('https://raw.githubusercontent.com/mProjectsCode/obsidian-meta-bind-plugin/release/Publish.js');
const script = await response.text();
eval(script);
}

await mb_load();

0 comments on commit f8d5517

Please sign in to comment.