Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%*
- const file = tp.file.find_tfile(tp.file.title);
- await app.fileManager.processFrontMatter(file, (frontmatter) => {
- // Replace "created" with the key you use
- if (!frontmatter["created"]) {
- frontmatter["created"] = tp.file.creation_date("YYYY-MM-DD HH:mm:ss")};
- });
- await app.fileManager.processFrontMatter(file, (frontmatter) => {
- // Replace "updated" with the key you use
- frontmatter["updated"] = tp.date.now("YYYY-MM-DD HH:mm:ss");
- });
- await app.fileManager.processFrontMatter(file, (frontmatter) => {
- // Replace "count" with the key you use
- if (frontmatter["viewCount"]) {
- frontmatter["viewCount"]++}
- else {
- frontmatter["viewCount"] = 1}
- });
- -%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement