Overview
Alver is a small town located in the Belmont Prefecture, surrounded by dense forests and foothills of the mountain range. The town is divided into four districts, each with its unique features.
Terryn Cleves is the current Burgomeister of Alver.
let current = dv.current();
let title = current.file?.name || current.name || "";
// 0. Suppress artwork search on template notes
if (title.toLowerCase().includes("template")) {
dv.paragraph(`*(Location / Building Image Preview)*`);
} else {
// 1. Gather all potential names (Title, quoted nicknames, and Obsidian Aliases)
let rawNames = [title];
// Extract quoted nickname if present in title (e.g. Holy Dominion "Estwatch" -> Estwatch)
let matchNick = title.match(/"([^"]+)"/);
if (matchNick && matchNick[1]) {
rawNames.push(matchNick[1]);
}
// Pull aliases safely
let aliases = current.file?.aliases || current.aliases || [];
if (typeof aliases === "string") {
rawNames.push(aliases);
} else if (Array.isArray(aliases) || (aliases && typeof aliases[Symbol.iterator] === "function")) {
for (let a of aliases) {
if (a && typeof a === "string") rawNames.push(a);
}
}
// 2. Build sanitized search terms
let searchTerms = new Set();
for (let name of rawNames) {
if (!name || typeof name !== "string") continue;
let lower = name.toLowerCase().trim().replace(/["']/g, "");
let slug = lower.replace(/[\s-]+/g, "_").replace(/^_+|_+$ /g, "");
if (lower.length >= 2) searchTerms.add(lower);
if (slug.length >= 2) searchTerms.add(slug);
}
// 3. Search target folders for matching image files (.png, .webp, .jpg, etc.)
let imageFolders = ["Images/Locations", "Image/Locations", "Images/Buildings", "Image/Buildings"];
let fallbackImage = "";
let matches = app.vault.getFiles().filter(f => {
let pathLower = f.path.toLowerCase();
let inTargetFolder = imageFolders.some(folder => pathLower.includes(folder.toLowerCase()));
if (!inTargetFolder) return false;
if (fallbackImage && pathLower.includes(fallbackImage.toLowerCase())) return false;
let imgName = f.name.toLowerCase();
return Array.from(searchTerms).some(term => term && imgName.includes(term));
});
// 4. Select match (prioritize "settlement", "overview", "cover", or "map", otherwise take the first file)
let match = matches.find(f => {
let nameLower = f.name.toLowerCase();
return nameLower.includes("settlement") || nameLower.includes("overview") || nameLower.includes("cover") || nameLower.includes("map");
}) || (matches.length > 0 ? matches[0] : null);
// 5. Render artwork, fallback image, or clean message
if (match && match.path) {
dv.paragraph(`![[${match.path}|cover]]`);
} else {
let fallbackFile = null;
if (fallbackImage && fallbackImage.trim() !== "") {
let cleanFB = fallbackImage.toLowerCase().trim();
fallbackFile = app.vault.getFiles().find(f =>
f.path.toLowerCase() === cleanFB ||
f.path.toLowerCase().includes(cleanFB) ||
f.name.toLowerCase().includes(cleanFB)
);
}
if (fallbackFile && fallbackFile.path) {
dv.paragraph(`![[${fallbackFile.path}|cover]]`);
} else {
dv.paragraph(`*No map or illustration found for ${title}*`);
}
}
}Districts
Areas & Points of Interest
West District
West District is the smallest of the four districts, located in the heart of the old village. It is a peaceful residential area with small houses and gardens. The residents of this district are mostly hunters and trappers, who make a living by selling furs and animal skins.
North Road
North Road district is the commercial heart of the town, where visitors can find a range of shops, stores, and markets selling mining and logging equipment. This district also has several inns, taverns, and restaurants that offer a taste of the local cuisine.
Lia's Gate
The Lia’s Gate, Alver district is the main entrance to the town, where visitors can find a cosy inn, a small market square, and some shops selling souvenirs and local crafts.
Noon Cliff
Noon Cliff district is located on the wesern side of the town, with a stunning view of the surrounding valleys. It is home to many wealthy merchants who prefer to live in a peaceful environment. Noon Cliff also has some beautiful gardens and orchards.
