29 lines
823 B
Markdown
29 lines
823 B
Markdown
<%*
|
|
const thisFile = tp.config.target_file;
|
|
const campaignData = tp.user.ttrpg.campaignData(thisFile)
|
|
const settingData = tp.user.ttrpg.settingData(thisFile);
|
|
const title = tp.file.title === "Untitled"
|
|
? await tp.system.prompt("Creature Name")
|
|
: tp.file.title;
|
|
|
|
const type = tp.frontmatter.creatureType ?? ""
|
|
const metadata = {
|
|
tags: ['ttrpg/creature'],
|
|
data: {
|
|
icon: "squirrel",
|
|
title,
|
|
pronunciation: tp.frontmatter.pronunciation ?? "",
|
|
summary: tp.frontmatter?.summary ?? "",
|
|
campaigns: [campaignData.link],
|
|
setting: settingData.link,
|
|
system: tp.frontmatter?.system ?? "",
|
|
creatureType: type,
|
|
adjective: tp.frontmatter?.adjective ?? "",
|
|
},
|
|
title,
|
|
};
|
|
await tp.user.util.updateMetadata(tp, metadata);
|
|
%>
|
|
|
|
<% tp.file.cursor() %>
|