Skip to content

Instantly share code, notes, and snippets.

@jtprogru
Created January 9, 2025 17:15
Show Gist options
  • Save jtprogru/c3e1b7358e4b436e72d3dfcce1cbc4bc to your computer and use it in GitHub Desktop.
Save jtprogru/c3e1b7358e4b436e72d3dfcce1cbc4bc to your computer and use it in GitHub Desktop.
Базовый шаблон для всех заметок в Obsidian, который правит остальными шаблонами и описывает правила их применения

<%* const title = tp.file.title

// "Meeting (Sync)" Notes if ((title.startsWith("Sync with - ")) || (title.startsWith("Meeting - "))) { return tp.file.include('[[Meeting template]]') }

// "People" Notes else if (title.startsWith("@")) { await tp.file.move("/Peoples/" + title) return tp.file.include('[[Person template]]') }

// "Themes" Notes else if (title.startsWith("Theme - ")) { await tp.file.move("/Media/Themes/" + title.substring(8)) return tp.file.include('[[Themes template]]') }

// "Book" Notes else if ((title.startsWith("Book - ")) || (title.startsWith("Книга - "))) { await tp.file.move("/Notes/" + title.substring(7)) return tp.file.include('[[Book template]]') }

// "Article" Notes else if ((title.startsWith("Article - ")) || (title.startsWith("Статья - "))) { await tp.file.move("/Notes/" + title.substring(10)) return tp.file.include('[[Article template]]') } // "MOC" Notes else if (title.startsWith("MOC - ")) { await tp.file.move("/MOCs/" + tp.file.title.substring(6)) return tp.file.include('[[MOC template]]') }

// "Place" Notes else if ((title.startsWith("Place - ")) || (title.startsWith("Место - "))) { await tp.file.move("/Notes/" + tp.file.title.substring(8)) return tp.file.include('[[Place template]]') }

// "PRFC" Notes else if (title.startsWith("PRFC-")) { await tp.file.move("/Work/PositiveTechnologies/PRFC/" + title) return tp.file.include('[[PRFC template]]') }

else if ((title.startsWith("Lecture - ")) || (title.startsWith("Лекция - "))) { return tp.file.include('[[Lecture template]]') }

// "New" Note else { return tp.file.include('[[New template]]') } %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment