|
1 |
| -<!DOCTYPE html> |
2 |
| -<html lang="en"> |
| 1 | +<!-- Add heatmap section at the top --> |
3 | 2 | <head>
|
4 | 3 | <meta charset="UTF-8">
|
5 | 4 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 | 5 | <title>Responsive Heatmap</title>
|
7 | 6 | <style>
|
| 7 | + .heatmap-section { |
| 8 | + margin-bottom: 30px; |
| 9 | + } |
| 10 | + |
8 | 11 | /* Default styles */
|
9 | 12 | .heatmap-container {
|
10 | 13 | display: block;
|
|
45 | 48 | <div>
|
46 | 49 | <div style="display: flex; justify-content: center; align-items: center">
|
47 | 50 | <p style="margin-right: 15px; margin-bottom: 0; padding: 8px">
|
48 |
| - {{ default "Article Activity" (.Get "title_text") }} |
| 51 | + {{ i18n "article_activity" }} |
49 | 52 | </p>
|
50 | 53 | <select id="yearSelector">
|
51 | 54 | <!-- Years will be dynamically added here -->
|
|
141 | 144 | function populatePostData() {
|
142 | 145 | var postsByDate = new Map();
|
143 | 146 | var years = new Set();
|
144 |
| - |
145 | 147 | {{ range ((where .Site.RegularPages "Type" "post")) }}
|
146 | 148 | var date = {{ .Date.Format "2006-01-02" }};
|
147 | 149 | var year = {{ .Date.Format "2006" }};
|
|
163 | 165 | totalWordCount += wordCount;
|
164 | 166 | data.set("totalWordCount", totalWordCount);
|
165 | 167 | postsByDate.set(date, data);
|
166 |
| - {{- end -}} |
| 168 | + {{- end -}} |
167 | 169 |
|
168 | 170 | years = Array.from(years).sort().reverse();
|
169 | 171 | return [postsByDate, years];
|
|
251 | 253 | yearLabel: { show: false },
|
252 | 254 | dayLabel: {
|
253 | 255 | firstDay: 1,
|
254 |
| - nameMap: {{ default "EN" (.Get "language")}} |
| 256 | + nameMap: "{{.Lang}}" |
255 | 257 | },
|
256 | 258 | monthLabel: {
|
257 |
| - nameMap: {{ default "EN" (.Get "language")}} |
| 259 | + nameMap: "{{.Lang}}" |
258 | 260 | },
|
259 | 261 | splitLine: {
|
260 | 262 | show: false,
|
|
268 | 270 | },
|
269 | 271 | backgroundColor: getTooltipBgColor(),
|
270 | 272 | formatter: function (params) {
|
271 |
| - const thousandWordsText = {{ default "EN" (.Get "language")}} === "EN" ? 'k words': '千字'; |
| 273 | + const thousandWordsText = {{ i18n "thousand_words" }}; |
272 | 274 | const date = params.data[0];
|
273 | 275 | const posts = postsByDate.get(date).get("posts");
|
274 | 276 | var content = `${date}`;
|
|
0 commit comments