A plugin for Obsidian that allows you to use dynamic variables in your notes by replacing {var_name} placeholders with values from your note's properties (frontmatter) in Live Preview mode.
-
Add Properties to Your Note
--- use-var: true character_name: "Alice" location: "Wonderland" age: 25 ---
-
Use Variables in Your Content
# The Adventures of {character_name} {character_name} was a curious girl who lived in {location}. At {age} years old, she discovered a magical rabbit hole... Later in the story, {character_name} met the Mad Hatter. -
See Live Results In Live Preview mode (with
use-var: trueenabled), you'll see:# The Adventures of Alice Alice was a curious girl who lived in Wonderland. At 25 years old, she discovered a magical rabbit hole... Later in the story, Alice met the Mad Hatter. -
Edit Variables Naturally (Live Preview only)
- Click on any variable to see its original
{variable_name}form - Edit the variable name directly in the text
- Click elsewhere to see the replaced value again
- Click on any variable to see its original
-
View in Reading Mode
- Switch to Reading mode to see variables replaced without editing capabilities
- Perfect for final review and sharing
- Download the latest release from the GitHub releases page
- Extract the files to your vault's
.obsidian/plugins/obsidian-variables/folder - Reload Obsidian
- Enable "Variables" in Community Plugins settings
- Clone this repository
- Run
npm install - Run
npm run devfor development ornpm run buildfor production - Copy
main.js,manifest.json, andstyles.cssto your plugins folder
This plugin is open source! Contributions are welcome:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request