Use H1 or front-matter title instead of or in addition to filename as display name

And the date!

This is crucial for me. I’m coming from Bear background and I have imported all my Bear notes to the Obsidian. The good thing about Bear was that I didn’t need to care about filename or anything like that – note was simply named after the first h1 heading. The most often I simply need to quickly jot something down and link it with some other concepts; the title is an afterthought. I liked to include certain characters ("?", “:”, etc.) and emojis in note titles to visually distinguish them, but these do not work nicely with filesystems’ filename constraints. Ideally (in my workflow), filenames should be only unique timestamps and the title itself would be sourced from the file itself (either title frontmatter field or h1). The question is, however, how internal links would behave – would they point to the filename or to the title?

I actually think that this front-matter idea, if properly generalized, could open a wide range of possibilities and new workflows. They could be extracted, aggregated, queried etc. It would enable one to treat their notes more like database records. For example, I store created timestamp in front-matter field and sometimes I need to sort my notes according to that. But that is outside the scope of this thread.

1 Like

Can this be approximated with the new command to autocomplete using headings after ##?

I skimmed above to see if this was said already, but a cool setting would be if we could specify some kind of parametric display name using a template.

So basically it would default to the file name, but templates can be something like {title} {date_created} or {first_h1} | {date_created} or something to that effect.

3 Likes

Into whatever direction this will go, the solution should not make the use of a yaml header mandatory. The current way it works is amazing exactly because it uses the information you have to give in any case (the filename) and reuses in at several occasions. I like it because it is simplistic and sets a low barrier within the workflow. Thus, what I like to see is the optional use of information from the yaml header in case it exists and a default mode that works just the way it works now.

6 Likes

As Icebear noted, we can get autocompletion of h1 by typing “[[##”.
It produces link in form “[[UIDfilename#readable header h1]]”.

  • issues:
    • Editing header outside Obsidian breakes corresponding links. Although link to UIDfilename will still work.
    • UIDfilename is always shown together with the header, cannot be hidden. (“UIDfilename > readable header h1”)

Here is one existing syntax for displaying up-to date link-titles as link text (see examples):
http://markua.com/#smart-crosslinks-m-
It uses markdown links, easy to adapt for wikilinks.

Writing “[[|#t ” (including trailing space) could turn on autocomplete for title / h1 / first line / filename / headers … and return link in form “[[filename|#t]]”. (Maybe it could be just “[[|#” → “[[filename|#]]”).
Writing just “[[|” could turn on autocomplete / global search for all content in all notes and return link in form “[[filename|search text]]

  • where:
  • filename” corresponds to note selected from autocomplete suggestions
  • #t” literal (or maybe just “#”)
    • when linking to file: … attempts to transclude (in preview) title / h1 / first line / filename, precedence according to this request
    • |#t” added to link to specific header “[[filename#some-header|#t]]” transcludes corresponding header only, without showing current "filename > " prefix.
  • search text” is literal text typed by user.

If this existing concise syntax is not desired for some reason then alternatively syntax used in templates could be used.


Related existing functionality: aliases

  • For start, it should be easy to recognize “title” in yaml header and treat it as one of aliases.
4 Likes

+1 I would appreciate if the graph view could toggle between the real file name as the node name and one, or any, of the following:

aliases: myalias (from the front matter yaml)
title: mytitle (from the front matter yaml)
# My H1 Title (actual, markdown title)`

I think my personal preference is aliases if there can be only one, as I currently use this to make UID links more friendly in all my notes, where I find title to be redundant as I always include a “# title” in my notes, and any given note will only ever have one “#” level heading. I am unsure if title: is used by any core functionality at this time, but I find it redundant. So aliases is just my selfish pick.

Any of these would potentially make the graph useful for those using meaningless UIDs in zettlekasten style.

Also, thank you, Obsidian is awesome software.

7 Likes

Absolutely agree with that. For instance, through a setting could be used the first (or unique) alias to be shown at graph instead of UIDs And when alias is not present, then show UID (note name) as always.

BUT maybe using a Title field in YAML would add compatibility with Zettlr, for instance.

If I had to choose one, I would take Title method for compatibility aspects.

This is the only pending point that is stopping me to start dumping all my notes to Obsidian.

2 Likes

Show [first header found in a file] next-to an ID-only-filename

Add options to show [first header found in a file] [next-to or instead-of] a filename:

  • In top bars above the page, or in vertical bars in Andy Matuschak mode (plugin).
  • In File Explorer
  • In Graph View
  • list of ‟Starred” files

Position of the header might be limited to first line if unrestricted search for header in large files is infeasible.

purpose:
Allow naming files using only concise permanent ID,
while seeing (showing to user) up-to-date human readable description in all appropriate places.

consequences of not having titles in filename:

  • Edit filename any time using any software (not only Obsidian) without breaking links.
  • Avoid need to change all links when title is changed and therefore reduce number of versions created by automatic backup systems.
  • Eliminate risk of exceeded maximum length of a pathname in some file systems.
  • Title can contain characters not permitted in filename, including forward slash.
  • Make markdown more concise/readable by using [[ID|note title]] instead of [[ID note title|note title]].

keywords: addressing, ID, zettelkasten

EDIT:
I found, it was already requested in Use H1 or front-matter title instead of or in addition to filename as display name
Related feature request: Show title of Zettelkasten notes in graph view

8 Likes

+1 to this!

1 Like

I’d like a set of fallbacks for this

  1. Front matter title
  2. First entry in aliases
  3. First header in file
  4. File name

Maybe the order should not be configurable so that the behavior is consistent.

5 Likes

Seconding on this, as already mentioned above my suggestion is to implement a title YAML tag to use in visualization-related scenarios instead of plain filenames. This solution is also compliant to ones adopted by other tools like pandoc and Zettlr, so it’s a step forward compatibility-wise too.

Plus, which YAML tags are supported should be documented in a dedicated page, maybe into an in-depth introduction about how front-matters work?

Thank you for your job!

5 Likes

yes this would be very nice

This would be really helpful! I use Zettelkasten IDs as file names in my vault. The introduction of aliases eased the pain of linking notes, but the graph and everything using file names as identifiers are still barely usable in this scenario.

3 Likes

Great suggestion. I’m Japanese, so I write the title of the note in Japanese.
However, I have concerns about the stability and flexibility of the file because the Japanese file names contain multiple bytes and contain NFD and NFC issues.

Being able to decouple the file name from the note title and attach a UID to the file name would eliminate these concerns.

8 Likes

That will be a great feature. For a Linux system, I prefer to follow “all lower case and underscore” as files’ name, while using H1 as a note’s title and link (so titles could include characters other than English characters).

1 Like

related: Support underscores "_" in block-id
(useful when refactoring blocks to separate files and vice versa)

+1 !
I too would like to be able to use the YAML frontmatter title instead of the file name in the graph.

2 Likes

I feel that #title is the more natural way to use a document title.

Edit: To use the first line as Title might be problematic. For example, I have my tags in the first line.

@jMatsuzaki Please, do not forget to like the original post by pressing :heart: under it, since it is officially prefered method of voting according to FAQ.
quote:

Rather than posting
“+1” or “Agreed”,
use the Like button.

1 Like