mirror of
https://github.com/davidvkimball/obsidian-yeet.git
synced 2026-07-22 06:54:58 +00:00
Publishes the active note to yeet.md and persists the per-snapshot delete token so the owner can unpublish later from inside Obsidian. Commands: - Publish current note (bind Ctrl/Cmd+Shift+Y under Settings -> Hotkeys) - Copy published link for current note - Unpublish current note - Show all published notes from this vault Publish state machine handles fresh publishes, unchanged-since-last- publish (copies existing URL, no duplicate), and content-changed (three-way modal: copy existing / publish new / delete old + publish). Status bar indicator on desktop shows published vs out-of-date state for the active note. Data stored per-vault in plugin data.json keyed by note path; vault rename events keep the record in sync with the active path. Token handling mirrors the yeet.md web client: server-generated, stored client-side only, sent over HTTPS in Authorization: Bearer header for delete. Per-vault UUID sent as X-Client-Id for rate limiting (not auth). Template: obsidian-sample-plugin-plus.
17 lines
784 B
JavaScript
17 lines
784 B
JavaScript
import { readFileSync, writeFileSync } from "fs";
|
|
|
|
const targetVersion = process.env.npm_package_version;
|
|
|
|
// read minAppVersion from manifest.json and bump version to target version
|
|
const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
|
|
const { minAppVersion } = manifest;
|
|
manifest.version = targetVersion;
|
|
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
|
|
|
|
// update versions.json with target version and minAppVersion from manifest.json
|
|
// but only if the target version is not already in versions.json
|
|
const versions = JSON.parse(readFileSync('versions.json', 'utf8'));
|
|
if (!Object.values(versions).includes(minAppVersion)) {
|
|
versions[targetVersion] = minAppVersion;
|
|
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
|
|
}
|