Format the text in or create a custom link to the file?

Things I have tried

  • using .replaceAll on, but it is not a string

What I’m trying to do

Because the repo I am using is in Azure it needs to have hyphens instead of spaces in file names. When I use in a dataviewjs I would like to format the text shown so that ‘my-file-name-link’ becomes ‘my file name link’.
I don’t mind if this is via formatting or creating something using and file.folder. I haven’t used JavaScript for a while so some help would be appreciated.
Thank you.

I know nothing about javascript. But using simple dataview query it’s possible to do that creating aliases.

  1. First you can create an aliases field in YAML frontmatter. E.g., for file my-file-name:
aliases: my file name
  1. Using new plugin features you can create a table query removing the file name and create a table column with an expression able to transform the aliases in file links. Something like this:
TABLE WITHOUT ID ("[[" + + "|" + file.aliases + "]]") as YourColumnTitle, file.tags

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.