笔记备份:2025-05-23 11:50:21

This commit is contained in:
2025-05-23 11:50:21 +08:00
parent 00ad407e1d
commit 5668d6cf4d
5 changed files with 109 additions and 5 deletions

View File

@@ -13,5 +13,6 @@
"dataview",
"homepage",
"obsidian-banners",
"auto-card-link"
"auto-card-link",
"title-only-tab"
]

View File

@@ -0,0 +1,75 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// main.ts
var main_exports = {};
__export(main_exports, {
default: () => ShortTabName
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");
var ShortTabName = class extends import_obsidian.Plugin {
async renameTab() {
const leaves = this.app.workspace.getLeavesOfType("markdown");
leaves.forEach((leaf) => {
var _a;
const view = leaf.view;
if (view == null ? void 0 : view.file) {
const file = view.file;
const cache = this.app.metadataCache.getFileCache(file);
const frontmatterTitle = (_a = cache == null ? void 0 : cache.frontmatter) == null ? void 0 : _a.title;
const tabHeaderEl = leaf.tabHeaderEl;
if (tabHeaderEl) {
const titleEl = tabHeaderEl.querySelector(".workspace-tab-header-inner-title");
if (titleEl) {
titleEl.setText(frontmatterTitle || file.basename);
}
tabHeaderEl.setAttribute("aria-label", frontmatterTitle || file.basename);
tabHeaderEl.setAttribute("title", frontmatterTitle || file.basename);
}
}
});
}
async onload() {
await this.renameTab();
this.registerEvent(
this.app.workspace.on("layout-change", () => this.renameTab())
);
this.registerEvent(
this.app.workspace.on("active-leaf-change", () => this.renameTab())
);
this.registerEvent(
this.app.workspace.on("file-open", () => this.renameTab())
);
this.registerEvent(
this.app.vault.on("rename", () => this.renameTab())
);
this.registerEvent(
this.app.metadataCache.on("changed", () => this.renameTab())
);
}
onunload() {
}
};
/* nosourcemap */

View File

@@ -0,0 +1,10 @@
{
"id": "title-only-tab",
"name": "Title-Only Tab",
"version": "1.0.1",
"minAppVersion": "1.4.16",
"description": "Set tab name to title in frontmatter for Jekyll users",
"author": "tristone13th",
"authorUrl": "https://github.com/tristone13th/",
"isDesktopOnly": false
}

View File

@@ -36,21 +36,35 @@
}
},
{
"id": "58f15eed5fa3f624",
"id": "c11e9a14d7515a97",
"type": "leaf",
"state": {
"type": "webviewer",
"state": {
"url": "https://obsidian.md/plugins?id=title-only-tab",
"url": "https://obsidian.md/plugins?id=note-status",
"title": "Plugins - Obsidian",
"mode": "webview"
},
"icon": "globe-2",
"title": "Plugins - Obsidian"
}
},
{
"id": "3a3c139a734411d9",
"type": "leaf",
"state": {
"type": "webviewer",
"state": {
"url": "https://github.com/devonthesofa/obsidian-note-status",
"title": "GitHub - devonthesofa/obsidian-note-status: Enhance your note organization with a status management system. Assign and track statuses (active, on hold, completed, dropped) for your notes with a customizable interface including status pane, dropdown, and file explorer integration.",
"mode": "webview"
},
"icon": "globe-2",
"title": "GitHub - devonthesofa/obsidian-note-status: Enhance your note organization with a status management system. Assign and track statuses (active, on hold, completed, dropped) for your notes with a customizable interface including status pane, dropdown, and file explorer integration."
}
}
],
"currentTab": 2
"currentTab": 3
}
],
"direction": "vertical"
@@ -257,8 +271,9 @@
"cmdr:打开浏览器视图": false
}
},
"active": "58f15eed5fa3f624",
"active": "3a3c139a734411d9",
"lastOpenFiles": [
"未命名.md",
"README.md",
"A1-Work/测试.md",
"A3-Tools/Dify/知识库相关配置.md",

3
.trash/未命名 5.md Normal file
View File

@@ -0,0 +1,3 @@
---
title: 测试
---