Skip to content

Commit 2b51c51

Browse files
committed
Generalize page title logic
1 parent 165a20d commit 2b51c51

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ fn get_webicon(family: &str, id: &str, vendor: Option<String>) -> (ContentType,
2525
let id = token::normalize_id(id, family);
2626

2727
let metadata = metadata::get_metadata(DEFAULT_CONFIG_FILE_PATH, family, &vendor);
28-
let emoji = token::get_emoji_from_id(&id).as_str();
29-
let title = format!("{} ({})", emoji, id);
28+
let title = match family {
29+
metadata::WebiconFamily::Emojis => {
30+
let emoji = token::get_emoji_from_id(&id).as_str();
31+
format!("{} ({})", emoji, id)
32+
}
33+
_ => format!("{}", id),
34+
};
3035
let html = webicons::html::make_html(&metadata, &title);
3136

3237
(ContentType::HTML, html.to_string())

0 commit comments

Comments
 (0)