Skip to content

Commit 6effe9b

Browse files
committed
Display wordCount in the title.
1 parent b29c441 commit 6effe9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layouts/shortcodes/heatmap.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,16 @@
141141
hideDelay: 1000,
142142
enterable: true,
143143
formatter: function (params) {
144+
const thousandWordsText = {{ .Get "language" }} === "EN" ? 'k words': '千字';
145+
const thousandWords = (params.data[1]/1000.0).toFixed(1);
144146
const date = params.data[0];
145147
const posts = postsByDate.get(date).get("posts");
146148
var content = `${date}`;
147149
for (const [i, post] of posts.entries()) {
148150
content += "<br>";
149151
var link = post.get("link");
150152
var title = post.get("title");
151-
content += `<a href="${link}" target="_blank">${title}</a>`
153+
content += `<a href="${link}" target="_blank">${title} | ${thousandWords}${thousandWordsText}</a>`
152154
}
153155
return content;
154156
}

0 commit comments

Comments
 (0)