No description
Find a file
2021-05-23 22:15:21 +02:00
.github/workflows update version, manifest and add workflows 2021-05-19 21:34:50 +02:00
imgs update readme with a gif for the autocomplete feature 2021-05-23 10:54:33 +02:00
suggest fix the folder exclusion logic 2021-05-23 16:26:50 +02:00
.editorconfig Initial POC 2021-05-18 21:39:08 +02:00
.gitignore Start setting up the plugin metadata 2021-05-16 15:53:11 +02:00
LICENSE Create LICENSE 2021-05-18 21:41:44 +02:00
main.ts Fix the overwrite of DEFAULT_SETTINGS 2021-05-23 18:24:50 +02:00
manifest.json re-bump version 0.1.4 2021-05-23 18:39:38 +02:00
package.json re-bump version 0.1.4 2021-05-23 18:39:38 +02:00
README.md Add steps in the roadmap 2021-05-23 16:45:37 +02:00
rollup.config.js Initial commit 2021-05-14 21:34:50 +02:00
settings.ts Fix the overwrite of DEFAULT_SETTINGS 2021-05-23 18:24:50 +02:00
styles.css Start setting up the plugin metadata 2021-05-16 15:53:11 +02:00
tsconfig.json Initial commit 2021-05-14 21:34:50 +02:00
utils.ts fix the folder exclusion logic 2021-05-23 16:26:50 +02:00
versions.json update versions file 2021-05-23 22:15:21 +02:00

Liquid Templates

This is a plugin for Obsidian (https://obsidian.md).

With this plugin, you can write your templates using LiquidJS tags

Disclaimer

This plugin is still under heavy development, so it's not optimized yet and has basic features.

Autocomplete

There is an aucomplete feature that by default is triggered by ;; but can be customized in the options

Examples

This means that you can create a template made from smaller ones, for example (assuming that your templates folder is templates):

templates/header.md

# Header

Insert a common header

templates/footer.md

---
I'm just a footer

templates/awesome_template.md

{% include "header" %}

This is the body of my note: {{title}}
link to today note [[{{date}}]]

{% include "footer" %}

When you create a note with the "Awesome template" template, you'll end up with:

A cool title.md

# Header

Insert a common header

This is the body of my note: A cool title
link to today note [[2021-05-21]

---
I'm just a footer

But other than that, you can use all the basic tags and filters

Template context

Other than the classic, date, time and title variable you also have:

Name Description
default_date_format The date format that you have specified in the plugin settings and can be used like this: {{ "now" | date: default_date_format }}
default_time_format The time format that you have specified in the plugin settings and can be used like this: {{ "now" | date: default_time_format }}

Roadmap

For now, this plugin just includes the basic version of LiquidJS, but I want to extend it to allow:

  • Add autocomplete to the template folder, excluded folder settings
  • Implement a fuzzy finder for the autocomplete
  • Implement/install a filter that allows you to write {{ 1 | days_ago | date: default_date_format }}
  • Parse a selected template string, something like you select {{ "dQw4w9WgXcQ" | youtube_iframe }} run a command and end up with the parsed result, in this case, the youtube iframe. (the youtube_iframe tag does not exist yet)