45 lines
1.2 KiB
Markdown
45 lines
1.2 KiB
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("Faction Name")
|
|
: tp.file.title;
|
|
const adjective = tp.frontmatter?.adjective ?? "";
|
|
const types = [
|
|
"family",
|
|
"military",
|
|
"secret society",
|
|
"political",
|
|
"government",
|
|
"religious",
|
|
"academic",
|
|
"criminal",
|
|
"social",
|
|
"commercial",
|
|
"ethnic group",
|
|
];
|
|
const type = tp.frontmatter.factionType ?? await tp.system.suggester(v => v, types, true, "Type of Faction");
|
|
const metadata = {
|
|
tags: ['ttrpg/faction'],
|
|
data: {
|
|
icon: "users",
|
|
title,
|
|
pronunciation: tp.frontmatter.pronunciation ?? "",
|
|
summary: tp.frontmatter?.summary ?? "",
|
|
campaigns: [campaignData.link],
|
|
setting: settingData.link,
|
|
factionType: type,
|
|
headquarters: tp.frontmatter?.headquarters ?? "",
|
|
leader: tp.frontmatter?.leader ?? "",
|
|
adjective: tp.frontmatter?.adjective ?? "",
|
|
},
|
|
title,
|
|
};
|
|
await tp.user.util.updateMetadata(tp, metadata);
|
|
%>
|
|
<% tp.file.cursor() %>
|
|
## Members
|
|
![[FactionInfo.base#Members]]
|
|
|