diff --git a/CHANGELOG.md b/CHANGELOG.md
index 046087f..def3352 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,5 @@
+# 0.28.4 (2025-03-15)
+- Feat: Template view can now access file properties
# 0.28.3 (2025-03-15)
- Fix: Filename field in files column no longer truncates name after dot
diff --git a/docs/renderers/template.md b/docs/renderers/template.md
index 8215dfa..159b562 100644
--- a/docs/renderers/template.md
+++ b/docs/renderers/template.md
@@ -6,9 +6,19 @@ Data from the query is exposed as `data` variable.
Learn more about handlebars syntax [in their official documentation](https://handlebarsjs.com/guide/).
+## Variables
+The following variables are exposed
+| Variable | Description |
+| ---------- | -------------------------------------------------- |
+| data | Array of the data returned by the SELECT statement |
+| columns | Array of column names |
+| properties | Object containing all properties of the file |
+
+
## Example
```sql
TEMPLATE
+Current Path: {{properties.path}}
{{#each data}}
{{path}}
{{/each}}
diff --git a/manifest.json b/manifest.json
index 56a2965..a5475b0 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"id": "sqlseal",
"name": "SQLSeal",
- "version": "0.28.3",
+ "version": "0.28.4",
"minAppVersion": "0.15.0",
"description": "Use SQL in your notes to query your vault files and CSV content.",
"author": "hypersphere",
diff --git a/package.json b/package.json
index 0457d37..0c11c09 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sqlseal",
- "version": "0.28.3",
+ "version": "0.28.4",
"description": "A plugin for Obsidian that allows you to run SQL queries on your notes.",
"main": "main.js",
"scripts": {
diff --git a/src/codeblockHandler/CodeblockProcessor.ts b/src/codeblockHandler/CodeblockProcessor.ts
index 5bf3132..2e2347e 100644
--- a/src/codeblockHandler/CodeblockProcessor.ts
+++ b/src/codeblockHandler/CodeblockProcessor.ts
@@ -122,7 +122,7 @@ export class CodeblockProcessor extends MarkdownRenderChild {
}
const { data, columns } = await this.db.select(transformedQuery, variables)
- this.renderer.render({ data, columns, flags: this.flags })
+ this.renderer.render({ data, columns, flags: this.flags, frontmatter: variables })
} catch (e) {
this.renderer.error(e.toString())
}
diff --git a/src/renderer/TemplateRenderer.ts b/src/renderer/TemplateRenderer.ts
index 3398add..30f1ffd 100644
--- a/src/renderer/TemplateRenderer.ts
+++ b/src/renderer/TemplateRenderer.ts
@@ -39,11 +39,11 @@ export class TemplateRenderer implements RendererConfig {
render(config: TemplateRendererConfig, el: HTMLElement) {
return {
- render: ({ columns, data }: any) => {
+ render: ({ columns, data, frontmatter }: any) => {
el.empty()
// Seems to be the only way to render handlebars into DOM. Don't like it but what can we do.
- el.innerHTML = config.template({ data, columns })
+ el.innerHTML = config.template({ data, columns, properties: frontmatter })
},
error: (error: string) => {
displayError(el, error)
diff --git a/versions.json b/versions.json
index 07a0139..c18a690 100644
--- a/versions.json
+++ b/versions.json
@@ -52,5 +52,6 @@
"0.28.0": "0.15.0",
"0.28.1": "0.15.0",
"0.28.2": "0.15.0",
- "0.28.3": "0.15.0"
+ "0.28.3": "0.15.0",
+ "0.28.4": "0.15.0"
}
\ No newline at end of file