Skip to content

Instantly share code, notes, and snippets.

@luckman212
Created April 17, 2021 13:07
Show Gist options
  • Select an option

  • Save luckman212/752703e29589d3595b3d95d521b330aa to your computer and use it in GitHub Desktop.

Select an option

Save luckman212/752703e29589d3595b3d95d521b330aa to your computer and use it in GitHub Desktop.
Obsidian Templater script to fetch tags and format them as YAML frontmatter
<%*
  var yaml = '';
  var tArr = tp.file.tags;
  tArr.sort();
  var tStr = tArr.join(', ').replace(/#/g,'');
  if (tStr.length) {
    yaml = '---\ntags: [' + tStr + ']\n---\n';
  }
%><%* tR += yaml %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment