- Ametrine
Digital garden template built with Astro
Bases Demo
Database-like views over your notes. Filter, sort, and display notes in tables.
What Are Bases?
Query notes by properties (tags, folders, dates, frontmatter), display results in tables, sort by columns, filter with expressions.
Base Files
Bases are .base files created in your Obsidian vault alongside your notes. This app reads them and generates the views.
Example projects.base:
views: - type: table name: Active Projects filters: and: - file.hasTag("project") - 'status == "active"' order: - file.name - status - priority - file.mtimeThe app automatically creates a page at /base/projects/active-projects for each view.
Filtering Basics
Simple Filters
Filter by tag:
filters: and: - file.hasTag("guide")Filter by folder:
filters: and: - file.inFolder("concepts")Filter by property:
filters: and: - 'status == "complete"' - 'priority > 3'Logical Operators
AND - All conditions must match:
filters: and: - file.hasTag("project") - 'status == "active"' - 'priority >= 5'OR - Any condition must match:
filters: or: - file.hasTag("urgent") - 'priority > 8' - 'deadline < today()'NOT - None of the conditions should match:
filters: not: - file.hasTag("archived") - 'draft == true'Nested Logic
Combine operators for complex queries:
filters: and: - file.inFolder("projects") - or: - 'status == "active"' - and: - 'status == "paused"' - 'priority > 7' - not: - file.hasTag("archived")Available Properties
File Properties
Access with file. prefix:
| Property | Type | Example |
|---|---|---|
file.name | String | Note title |
file.path | String | Full path/slug |
file.folder | String | Parent folder |
file.ext | String | File extension |
file.ctime | Date | Created time |
file.mtime | Date | Modified time |
file.tags | Array | All tags |
file.links | Array | Outgoing links |
Note Properties
Access directly from frontmatter:
filters: and: - 'status == "published"' - 'author == "John Doe"' - 'priority >= 5'Any frontmatter field can be used: title, description, author, status, priority, etc.
Built-in Functions
File Functions
file.hasTag(tag) - Check for tag (includes nested tags):
filters: and: - file.hasTag("project")file.inFolder(folder) - Check folder location:
filters: and: - file.inFolder("guides")file.hasProperty(name) - Check if property exists:
filters: and: - file.hasProperty("author")file.hasLink(path) - Check if note links to another:
filters: and: - file.hasLink("index")Comparison Operators
Use in filter expressions:
==- Equals!=- Not equals>- Greater than<- Less than>=- Greater than or equal<=- Less than or equal
Date Functions
now() - Current date and time
today() - Current date (time = 00:00:00)
filters: and: - 'file.mtime > today()' # Modified todayMultiple Views
One base can have multiple views:
views: - type: table name: All Projects order: - file.name - status - priority
- type: table name: Active Only filters: and: - 'status == "active"' order: - priority - file.name
- type: table name: High Priority filters: and: - 'priority >= 8' order: - priority - file.mtimeEach view gets its own tab and URL:
/base/projects/all-projects/base/projects/active-only/base/projects/high-priority
Ordering Columns
The order field controls which columns appear and their sequence:
order: - file.name # Note title (linked) - status # Frontmatter property - priority # Another property - file.tags # Tags as badges - file.mtime # Modified date - description # Description fieldColumns are displayed left to right in the specified order.
View Types
Table View
views: - type: table name: My Table order: - file.name - status - file.mtimeOther View Types
Only table is currently implemented. Planned: cards, list, map.
Configuration Examples
Documentation Hub
views: - type: table name: All Docs filters: or: - file.hasTag("guide") - file.hasTag("reference") - file.hasTag("documentation") order: - file.name - file.tags - file.mtime
- type: table name: Guides filters: and: - file.hasTag("guide") order: - file.name - descriptionProject Tracker
views: - type: table name: Active Projects filters: and: - file.hasTag("project") - 'status == "active"' order: - priority - file.name - status - deadline
- type: table name: Completed filters: and: - file.hasTag("project") - 'status == "complete"' order: - file.mtime - file.nameReading List
views: - type: table name: To Read filters: and: - file.hasTag("book") - 'status == "unread"' order: - priority - author - file.name
- type: table name: Finished filters: and: - file.hasTag("book") - 'status == "read"' limit: 20 order: - file.mtime - rating - file.nameLimiting Results
Use limit to show only top N results:
views: - type: table name: Recent Updates limit: 10 # Only show 10 most recent order: - file.mtime - file.nameResults are limited AFTER filtering.
Tips and Tricks
Tag Hierarchies
file.hasTag() matches nested tags:
file.hasTag("project") # Matches "project/web", "project/mobile", etc.Property Existence
Check if a field exists before comparing:
filters: and: - file.hasProperty("status") - 'status == "active"'Case-Sensitive Comparisons
String comparisons are case-sensitive:
'status == "Active"' # Won't match "active"Normalize your property values for consistency.
Empty Filters
Omit filters to show all notes:
views: - type: table name: Everything order: - file.name - file.mtimeCombining Global and View Filters
Global filters apply to ALL views:
filters: and: - file.inFolder("projects") # Global: only project folder
views: - type: table name: Active filters: and: - 'status == "active"' # View: only active onesGlobal and view filters are combined with AND.
Examples
All Notes - All notes in a table
Showcase Base - Filtered by tag
Recent Updates - 20 most recent
How It Works
.basefiles parsed at build time- Filters evaluated against all notes
- Results sorted by specified properties
- Static HTML pages generated
- No client-side processing required
Troubleshooting
Base Not Showing
Check:
- File has
.baseextension - File is in your vault (which should be symlinked to
/src/content/vault/) - YAML is valid (use a validator)
- At least one view is defined
- Dev server restarted
No Results
Check:
- Filters might be too restrictive
- Property names are correct (case-sensitive)
- Notes have the expected properties/tags
- Use
filters: {}to see all notes first
Expression Errors
Common issues:
- Missing quotes around strings:
status == "active"✓ - Wrong operators: Use
==not= - Invalid property names: Check frontmatter
- Typos in function names:
file.hasTagnotfile.hasTag()
Build Errors
If build fails:
- Check YAML syntax (indentation matters)
- Verify view types are valid:
table,cards,list,map - Ensure
viewsis an array - Check for circular references
Planned Features
- Formula properties (computed values)
- Cards view (gallery layout)
- List view (bulleted/numbered)
- Map view with coordinates
- Advanced functions (dates, strings, lists)
- Custom property display config
- Export to CSV/JSON
Usage
- Create a
.basefile in your Obsidian vault - Define views with filters and ordering
- Build generates pages at
/base/yourbase/viewname