JEKYLL
HTML
JAVASCRIPT
add-tag-count
μμ κ°μ tagμ ν΄λΉνλ ν¬μ€νΈ μλ₯Ό ꡬννκ³ μ νλ€.
var js_categories = {{CATEGORY | split: ',' | join: ','}};
var js_category_list = {{CATEGORYS|split:','|join:','}};
// console.log(js_categories);
// console.log(js_category_list);
let js_category = {};
for (var now in js_category_list) {
js_category[js_category_list[now]] = 0;
}
for (var now in js_categories) {
var text = js_categories[now];
js_category[text] = js_category[text] + 1;
}
// console.log(js_category);
for (var now in js_category) {
var text = "(" + js_category[now] + ")";
// console.log(text);
document.getElementById(now).innerText =text;
}
//
liquidμ javaScriptλ₯Ό λμμ μ¬μ©νκΈ°μ ꡬ쑰μ μΌλ‘ λν΄νλ€.
const categories = {
{% for category in site.categories %}
{% capture category_name %}
{{ category | first }}
{% endcapture %}
{{ category_name | replace: " ", "_" }}:
[{% for post in site.categories[category_name] %}
{ url: `{{ site.baseurl }}{{ post.url }}`,
date: `{{post.date | date_to_string}}`,
title: `{{post.title}}`},
{% endfor %}],
{% endfor %} }
μ¬μ©μ€μ΄λ νλ‘κ·Έλ¨μμ μ μν λ°©μμ΄μ§λ§ μ΄κ²μ λ λν΄νκ³ , html + jekyll μ§μμ΄ λ νμνκ²κ°μ λμ€μ μ΅μν΄μ§λ©΄ ν΄μν΄λ³΄κ³ μ νλ€.
