Skip to content

Content Templates

Björn Platte edited this page Feb 9, 2026 · 2 revisions

Content Templates

Content templates define the structure of issue and pull request notes. You can create custom template files and reference them in the settings.

Setting Up

  1. Create a template file in your vault (e.g., Templates/GitHub Issue.md)
  2. Enable "Use custom content template" in repository/project settings
  3. Select your template file

Template Example

---
title: "{title_yaml}"
number: {number}
state: "{state}"
type: "{type}"
created: "{created}"
updated: "{updated}"
url: "{url}"
author: "{author}"
assignees: {assignees_yaml}
labels: {labels_yaml}
---

# {title}

{body}

{sub_issues:## Sub-Issues ({sub_issues_progress})
{sub_issues_list}
}

{parent_issue:> **Parent Issue:** {parent_issue_link}
}

{comments}

{% persist "notes" %}
## My Notes

{% endpersist %}

Available Variables

See Template-Variables for all available variables.

Most Used Variables

Frontmatter:

  • {title_yaml} - YAML-safe title
  • {number}, {state}, {type}
  • {created}, {updated}, {closed}
  • {assignees_yaml}, {labels_yaml}
  • {url}, {author}

Content:

  • {title} - For headings
  • {body} - Issue/PR description
  • {comments} - Formatted comments section
  • {sub_issues_list} - Sub-issues with status icons
  • {parent_issue_link} - Link to parent issue

Conditional Blocks

Show content only when a variable has a value:

{closed:- **Closed:** {closed}}
{milestone:- **Milestone:** {milestone}}
{sub_issues:## Sub-Issues\n{sub_issues_list}}

Template Logic

For advanced template features like if/elif/else blocks, value mappings, and dynamic project fields, see Template-Logic.

Pull Request Specific

---
baseBranch: "{baseBranch}"
headBranch: "{headBranch}"
merged: {merged}
---

{merged:This PR was merged on {mergedAt}.}

**Branches:** `{headBranch}` -> `{baseBranch}`

GitHub Projects

---
project: "{project}"
status: "{project_status}"
priority: "{project_priority}"
iteration: "{project_iteration}"
---

{project:## Project Info
- **Project:** [{project}]({project_url})
- **Status:** {project_status}
{project_priority:- **Priority:** {project_priority}}
{project_iteration:- **Iteration:** {project_iteration}}
}

Sub-Issues

{sub_issues:## Sub-Issues ({sub_issues_progress})

{sub_issues_list}
}

{parent_issue:> This is a sub-issue of {parent_issue_link}
}

The {sub_issues_list} displays:

  • Status indicators (green/red dots)
  • Internal Obsidian links if the sub-issue exists in your vault
  • External GitHub links if not

Tips

  1. Use YAML-safe variables in frontmatter ({title_yaml} instead of {title})
  2. Wrap conditional content in conditional blocks
  3. Use persist blocks for your own notes (see Persist-Blocks)
  4. Test your template with a simple issue first

Clone this wiki locally