Last active
March 30, 2022 17:02
-
-
Save exdeejay/6fe8cfb7d4671538c61140686e696a51 to your computer and use it in GitHub Desktop.
Obsidian Dataview snippet - List all pages that aren't linked to in any other file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Homeless Notes | |
| *Notes that aren't linked to at all* | |
| %% Copy the below text, including the ```, to use in your own file %% | |
| %% Make sure to turn on "Enable Javascript Queries" in Dataview's settings! %% | |
| ```dataviewjs | |
| // Lists all pages that aren't linked to in any other file. | |
| // Fill `unlisted` with all the pages/directories | |
| // you don't want to show up in this list | |
| let unlisted = ['+Home', 'Daily', 'Templates', 'Archive'] | |
| dv.list( | |
| dv.pages(unlisted.map(f => `!"${f}"`).join(' AND ')) | |
| .filter(f => f.file.inlinks.length == 0) | |
| .sort(f => f.file.name, 'asc') | |
| .map(f => f.file.link) | |
| ) | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment