YM Homepage
unlistedby yunmin311
Open a chosen note when Obsidian starts, and keep its index links up to date on their own.
YM Homepage
Open a chosen note when Obsidian starts, and keep its index links up to date on their own.
What it does
Two things, both about the same idea — turning a note into a homepage.
It opens on startup. Point it at a note and Obsidian lands there instead of on whatever the last session left behind. There is no built-in homepage in Obsidian, so without something doing this the note is just a note.
Its link list keeps itself current. Write a home-links block wherever you want the
links, and it builds the list from rules. Rename a note, add a new index, and the list follows
— nothing to maintain by hand. That is the part a hand-written list cannot do, and the reason
the old list drifted out of date.
Design notes
It scans the vault itself; it does not use Dataview. Two reasons. Layout has to be fully
under this plugin's control — a homepage's type sizes and whitespace are the design, and
handing that to a query engine means accepting its defaults. And this plugin line has no
third-party dependencies by policy: one less dependency is one less thing that can break the
plugin from the outside. Scanning is cheap (vault.getMarkdownFiles() reads a cache) and only
happens when the note renders.
The rules use the same wildcard syntax as Quiet Shelf — index exact, index* prefix,
*index suffix, *index* contains. You already know that syntax from the other plugin, and
one mental model is better than two.
Link text comes from aliases, falling back to the file name. So to show 英语学习 instead
of _English Learning Hub, add an alias to that note — the standard Obsidian way, rather than
a link alias you have to retype every time the list changes.
One trap worth knowing. github ends with hub. So *hub and *hub* will both pull
in github-flavoured notes; hub* and a bare hub will not. This is not a bug, it is what
suffix matching means — the settings page says so too.
Blank space above the links is a setting, measured in percent of viewport height. A fixed value would sit just below the fold on a small screen and comfortably inside view on a large one; a viewport-relative one means "you have to scroll" everywhere. Default 55.
Install
Not yet in the community directory. To install manually:
- Download
main.js,manifest.jsonandstyles.cssfrom the latest release. - Put them in
<your vault>/.obsidian/plugins/ym-homepage/. - Enable YM Homepage in Settings → Community plugins.
Usage
Put this where the links should appear:
```home-links
```
Or run YM Homepage: Insert a homepage link block. The block has no options — it reads the rules from settings.
Settings
| Setting | Default | Notes |
|---|---|---|
| Interface language | Follow Obsidian | zh / en |
| Path of the homepage note | homepage.md | Full path from the vault root, with .md |
| Open on startup | on | |
| How to open it | Replace the current tab | Or open in a new tab |
| File names to collect | *Index*, *Hub* | One wildcard rule per line |
| Blank space above the links | 55 | Percent of viewport height |
Requirements
Obsidian 1.4.0 or later. Desktop and mobile.
License
MIT — see LICENSE.
中文说明
开机时打开指定的那篇笔记,并让它底部的索引链接自己保持最新。
有什么
开机打开它。 指定一篇笔记,Obsidian 启动后直接落在那里,而不是落在上次留下的那篇。 Obsidian 本身没有「首页」这个东西——没有插件负责打开它,那它就只是一篇普通笔记。
链接列表自己保持最新。 在你想放链接的地方写一个 home-links 代码块,它按规则生成
列表。笔记改名了、新增了一个索引,列表跟着变——不需要手工维护。这正是一份手写列表做不到
的事,也是旧那份列表会过期的原因。
设计约定
它自己扫库,不用 Dataview。 两个理由:排版必须完全由这个插件掌控——首页的字号与留白
就是设计本身,交给查询引擎就等于接受它的默认样式;而这条插件线的原则是零第三方依赖,
少一个依赖就少一类「它升级了我就挂」。扫库很便宜(getMarkdownFiles() 读的是缓存),
而且只在笔记渲染时跑一次。
规则与 Quiet Shelf 同一套通配符语法 —— index 精确、index* 前缀、*index 后缀、
*index* 包含。你已经在那边熟悉它了,一套心智模型好过两套。
链接显示名优先取 aliases,否则用文件名。 想让 _English Learning Hub 显示成
「英语学习」,给那篇笔记加一个别名即可——这是 Obsidian 的标准做法,好过每次列表变化都要
重打一遍链接别名。
一个值得知道的陷阱。 github 是以 hub 结尾的。所以 *hub 和 *hub* 都会把
github 相关的笔记收进来;hub* 和裸词 hub 不会。这不是 bug,是后缀匹配的必然结果——
设置页里也写了。
链接上方的留白是设置项,单位是视口高度的百分比。用固定值的话,小屏上会刚好露在折叠线 下面、大屏上又稳稳在视野里;用视口相对值才能让「要往下滚」在任何屏幕上成立。默认 55。
安装
尚未上架社区目录。手动安装:
- 从最新的 Release 下载
main.js、manifest.json、styles.css。 - 放进
<你的 vault>/.obsidian/plugins/ym-homepage/。 - 在「设置 → 第三方插件」里启用 YM Homepage。
用法
在想放链接的位置写:
```home-links
```
或用命令 YM Homepage: 插入首页链接区块。代码块不接受参数——规则在设置页里。
设置
| 设置项 | 默认 | 说明 |
|---|---|---|
| 界面语言 | 跟随 Obsidian | 中文 / 英文 |
| 首页笔记的路径 | homepage.md | 从库根算起的完整路径,带 .md |
| 启动时打开 | 开 | |
| 打开方式 | 替换当前标签 | 也可在新标签页打开 |
| 要收进来的文件名 | *Index*、*Hub* | 每行一条通配符规则 |
| 链接上方留多少空 | 55 | 视口高度的百分比 |
依赖
Obsidian 1.4.0 及以上。桌面端与移动端均可用。
许可
MIT —— 见 LICENSE。
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.