Fixing broken image links in Card Gallery and adding Immortal filter
This commit is contained in:
Vendored
+3
-1
@@ -1 +1,3 @@
|
||||
{}
|
||||
{
|
||||
"alwaysUpdateLinks": true
|
||||
}
|
||||
+3
-1
@@ -1 +1,3 @@
|
||||
[]
|
||||
[
|
||||
"frontmatter-folder-organizer"
|
||||
]
|
||||
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
"use strict";var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var w=(i,t)=>{for(var e in t)d(i,e,{get:t[e],enumerable:!0})},z=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!y.call(i,r)&&r!==e&&d(i,r,{get:()=>t[r],enumerable:!(n=F(t,r))||n.enumerable});return i};var S=i=>z(d({},"__esModule",{value:!0}),i);var b={};w(b,{default:()=>m});module.exports=S(b);var g=require("obsidian");var l=require("obsidian"),f={frontmatterHierarchy:"Category, Faction"},h=class extends l.PluginSettingTab{constructor(t,e){super(t,e),this.plugin=e}display(){let{containerEl:t}=this;t.empty(),t.createEl("h2",{text:"Frontmatter Folder Organizer"}),new l.Setting(t).setName("Frontmatter hierarchy").setDesc("Enter frontmatter keys in order. Files will be organized into folders based on these values.").addTextArea(e=>e.setPlaceholder("category").setValue(this.plugin.settings.frontmatterHierarchy).onChange(async n=>{this.plugin.settings.frontmatterHierarchy=n,await this.plugin.saveSettings()})),new l.Setting(t).setName("Organize files now").setDesc("Create folders and move markdown files according to the configured frontmatter hierarchy.").addButton(e=>e.setButtonText("Organize now").onClick(async()=>{await this.plugin.organizeFilesByFrontmatter()}))}};var m=class extends g.Plugin{async onload(){await this.loadSettings(),this.addCommand({id:"organize-frontmatter-folders",name:"Organize markdown by frontmatter hierarchy",callback:async()=>{await this.organizeFilesByFrontmatter()}}),this.addSettingTab(new h(this.app,this))}async organizeFilesByFrontmatter(){let t=this.getHierarchyKeys();if(!t.length){new g.Notice("Set a frontmatter hierarchy in plugin settings before organizing files.");return}let e=this.app.vault.getFiles().filter(r=>r.extension==="md"),n=0;for(let r of e){let a=this.getFolderSegmentsForFile(r,t);if(!a||!a.length)continue;let s=a.join("/");if(`${s}/${r.name}`===r.path)continue;await this.ensureFolderExists(s);let c=await this.getAvailableTargetPath(s,r.name);await this.app.vault.rename(r,c),n+=1}new g.Notice(`Organized ${n} markdown file${n===1?"":"s"} by frontmatter folder hierarchy.`)}getHierarchyKeys(){return this.settings.frontmatterHierarchy.split(/[,\r\n]+/).map(t=>t.trim()).filter(Boolean)}getFolderSegmentsForFile(t,e){let n=this.app.metadataCache.getFileCache(t);if(!n?.frontmatter)return null;let r=[];for(let a of e){let s=this.getFrontmatterValueByKey(n.frontmatter,a),o=this.normalizeFrontmatterValue(s);if(o===null)break;r.push(this.sanitizeFolderName(o))}return r.length?r:null}getFrontmatterValueByKey(t,e){let n=e.trim().toLowerCase();for(let[r,a]of Object.entries(t))if(r.trim().toLowerCase()===n)return a}normalizeFrontmatterValue(t){if(t==null||typeof t=="object")return null;let e=String(t).trim();return e.length?e:null}sanitizeFolderName(t){return t.replace(/[<>:"/\\|?*]/g,"-").trim()}async ensureFolderExists(t){let e=t.replace(/\\/g,"/").split("/").filter(Boolean),n="";for(let r of e)n=n?`${n}/${r}`:r,this.app.vault.getAbstractFileByPath(n)||await this.app.vault.createFolder(n)}async getAvailableTargetPath(t,e){let n=t.replace(/\\/g,"/"),r=`${n}/${e}`;if(!this.app.vault.getAbstractFileByPath(r))return r;let a=e.lastIndexOf("."),s=a>=0?e.slice(0,a):e,o=a>=0?e.slice(a):"",c=1;for(;;){let u=`${n}/${s}-${c}${o}`;if(!this.app.vault.getAbstractFileByPath(u))return u;c+=1}}async loadSettings(){this.settings=Object.assign({},f,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "frontmatter-folder-organizer",
|
||||
"name": "Frontmatter Folder Organizer",
|
||||
"version": "1.0.0",
|
||||
"minAppVersion": "1.0.0",
|
||||
"description": "Organize markdown files into folders based on frontmatter hierarchy.",
|
||||
"author": "Obsidian",
|
||||
"authorUrl": "https://obsidian.md",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
|
||||
This CSS file will be included with your plugin, and
|
||||
available in the app when your plugin is enabled.
|
||||
|
||||
If your plugin does not need CSS, delete this file.
|
||||
|
||||
*/
|
||||
Vendored
+60
-48
@@ -13,12 +13,24 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Decks/Big Energy.md",
|
||||
"file": "Immortalized/[[Splintergleam]]/The Ripper.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Big Energy"
|
||||
"title": "The Ripper"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "260e40ab6f70e60e",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "image",
|
||||
"state": {
|
||||
"file": "Agents Immortalized/Lifeblood/Horticulturist Oswald.png"
|
||||
},
|
||||
"icon": "lucide-image",
|
||||
"title": "Horticulturist Oswald"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -95,7 +107,7 @@
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "Immedi",
|
||||
"query": "The Ripper",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
@@ -225,55 +237,55 @@
|
||||
"bases:Create new base": false
|
||||
}
|
||||
},
|
||||
"active": "d6fd830908a482d3",
|
||||
"active": "0ce4e65b7e2934e1",
|
||||
"lastOpenFiles": [
|
||||
"Decks/Big Energy.md",
|
||||
"Disarm.md",
|
||||
"Factions/Singularity.md",
|
||||
"Spells/Lifeblood/Affront to Nature.md",
|
||||
"Spells/Singularity/Aggressive Recycling.md",
|
||||
"Mute.md",
|
||||
"Agents/Sungrace/Brilliant Martyr.md",
|
||||
"Decks/Sub/Big Energy.md",
|
||||
"Decks/Sub",
|
||||
"Redirects/Agents.md",
|
||||
"_Timeline.base",
|
||||
"Redirects",
|
||||
"Rules/Chain.md",
|
||||
"Rules/Discarded.md",
|
||||
"Rules/Round End.md",
|
||||
"Rules/Core.md",
|
||||
"Keywords/Sprout.md",
|
||||
"Rules",
|
||||
"Speed/Fast.md",
|
||||
"Speed/Immediate.md",
|
||||
"Speed/Slow.md",
|
||||
"Speed",
|
||||
"Tokens/Pocket Scout.md",
|
||||
"Immortalized/[[Splintergleam]]/The Ripper.png",
|
||||
"Immortalized/[[Splintergleam]]/The Ripper.png.crdownload",
|
||||
"Agent/[[Splintergleam]]/Toothy Pugilist.md",
|
||||
"Immortalized/[[Silence]]/Alina Who Cuts the Strings.md",
|
||||
"Agent/[[Silence]]/Destiny Ripper.md",
|
||||
"Immortalized/[[Splintergleam]]/The Ripper.md",
|
||||
"Immortalized/[[Splintergleam]]/Sareh, Rebel Strategist.md",
|
||||
"Immortalized/[[Splintergleam]]/Scoot Sparkles.md",
|
||||
"Immortalized/[[Splintergleam]]/Scoot Sparkles.png",
|
||||
"Immortalized/[[Splintergleam]]/Scoot Sparkles.png.crdownload",
|
||||
"Agent/[[Phasetide]]/Divergence Assassin.md",
|
||||
"Immortalized/[[Lifeblood]]/Horticulturist Oswald.md",
|
||||
"Immortalized/[[Phasetide]]/Violent Inquisitioner.md",
|
||||
"Immortalized/[[Silence]]/A'kon, Starry Diviner.md",
|
||||
"Immortalized/[[Phasetide]]/Masa, Time-Lost.md",
|
||||
"Immortalized/[[Phasetide]]/Dedicated Missionary.md",
|
||||
"Immortalized/[[Phasetide]]/Violet Inquisitioner.md",
|
||||
"Immortalized/[[Phasetide]]/Zel, the First Diver.md",
|
||||
"Immortalized/[[Phasetide]]/The 'Stache.md",
|
||||
"Immortalized/[[Phasetide]]/Symphony of the Path.md",
|
||||
"Immortalized/[[Phasetide]]/Grand Judge Dhael.md",
|
||||
"Immortalized/[[Phasetide]]/Harker, Metal Reporter.md",
|
||||
"Immortalized/[[Phasetide]]/Khaela the Savior.md",
|
||||
"Immortalized/[[Phasetide]]/Pontifex Dhabu.md",
|
||||
"Immortalized/[[Phasetide]]/Priestess Minia.md",
|
||||
"Immortalized/[[Phasetide]]/Rift Mender Aris.md",
|
||||
"Agents Immortalized/Lifeblood/Horticulturist Oswald.png",
|
||||
"Immortalized/[[Lifeblood]]/Gritmancer Grant.md",
|
||||
"Immortalized/[[Phasetide]]/Consequence Admin Cain.md",
|
||||
"Immortalized/[[Phasetide]]/Alina, the Overflowing Cup.md",
|
||||
"Decks/Rewind Me.canvas",
|
||||
"Agents Immortalized/Silence/A'kon, Starry Diviner.png",
|
||||
"Agent/[[Lifeblood]]",
|
||||
"Agent/[[Singularity]]",
|
||||
"Agent/[[Phasetide]]",
|
||||
"Agent/[[Silence]]",
|
||||
"Agent/[[Sungrace]]",
|
||||
"Agent/[[Splintergleam]]",
|
||||
"Agent",
|
||||
"Immortalized/[[Phasetide]]",
|
||||
"Agents/Phasetide/Divergence Assassin.png",
|
||||
"Agents/Phasetide/Divergence Assasin.png",
|
||||
"Agents Immortalized/Lifeblood/Horticulturalist Oswald.png",
|
||||
"Agents/Singularity/Awakened Security System.png",
|
||||
"Tokens/Seedling.png",
|
||||
"Tokens/Pocket Scout.png",
|
||||
"Factions/Silence.md",
|
||||
"Tokens/Wolf.md",
|
||||
"Tokens",
|
||||
"Sets",
|
||||
"Sets/Core Set.md",
|
||||
"_Spells.base",
|
||||
"_Keyword.base",
|
||||
"_Factions.base",
|
||||
"Rules/Cores.md",
|
||||
"Factions/Sungrace.md",
|
||||
"Factions/Phasetide.md",
|
||||
"Factions/Splintergleam.md",
|
||||
"Untitled.md",
|
||||
"Khaelar.png",
|
||||
"Agents Immortalized/Singularity/Zorp, Unrecyclable.png",
|
||||
"Agents Immortalized/Singularity/Ziv, the Adaptable.png",
|
||||
"Agents Immortalized/Phasetide/Zel, the First Diver.png",
|
||||
"Agents/Lifeblood/Zealot of the Hunt.png",
|
||||
"Agents Immortalized/Silence/Ylka, the Headliner.png",
|
||||
"Agents Immortalized/Lifeblood/Xae, Dreamstrider.png",
|
||||
"Agents Immortalized/Lifeblood/Wreck-o Rex.png",
|
||||
"Decks/Rewind Me.canvas",
|
||||
"_Agents.canvas"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user