Nav Weight
approvedby shu307
Sort your navigation items by markdown frontmatter.
Nav Weight
[中文]
A simple plugin designed to sort files in navigation based on markdown frontmatter (also known as metadata) for Obsidian.
This plugin sorts files by recognizing the weight key defined in the markdown frontmatter, using its value as a criterion for ordering.
While several plugins are available for customizing navigation, I created this particular plugin because the others tend to be overly complex for someone as lazy as me.
Usage
Make sure the following icon in the left ribbon is activated (lit up). You can enable/disable the plugin temporary as you wish by clicking it, but not now.
Data Preparing
Define some weight in your markdown files, like:
---
weight: 1
---
[!NOTE] To sort a
folder, you need anindexfile within it. The file name of theindexcan be configured in Settings. Theweightof theindexwill be used as theweightof thefolder.Additionally, the
indexitself has a fixedweightthat can also be configured in Settings.
Sorting
When the left ribbon icon is activated, sorting is automatic if you have defined some weight.
Result checking
You can find one of the following icons in the bottom status bar. Move your mouse over the icon to see the tooltip.
Additional
[!TIP] If you are using MkDocs as your documentation publisher, you can find a similar plugin for MkDocs at this link.
All features of mkdocs-nav-weight have been implemented in this plugin, but you need to manually enable this feature in the Settings.
After sorting, you may encounter the following icons, which respectively represent headless: true or empty: true, and retitled: true, displayed alongside the names of files or folders.
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.