Constant tpnote_lib::config::TMPL_NEW_CONTENT
source · pub const TMPL_NEW_CONTENT: &str = "\
{%- set title_text = dir_path | trim_file_sort_tag -%}
---
title: {{ title_text | cut | json_encode }}
subtitle: {{ 'Note' | json_encode }}
author: {{ username | capitalize | json_encode }}
date: {{ now() | date(format='%Y-%m-%d') | json_encode }}
lang: {{ title_text | get_lang | map_lang(default=lang) | json_encode }}
---
";Expand description
Default content template used when the command line argument <sanit>
is a directory. Can be changed through editing the configuration
file. The following variables are defined:
{{ path }}: points to the directory where the new note will be created.{{ dir_path }}is in this context identical to{{ path }}. In addition, all environment variables can be used, e.g.{{ get_env(name=\"LOGNAME\") }}When placed in YAML front matter, the filter| json_encodemust be appended to each variable.