-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthors.html
36 lines (35 loc) · 1.26 KB
/
authors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
layout: default
title: 작성자 글 모아보기
---
<section class="container">
<h1 class="title">Posts</h1>
{% for author in site.data.authors %}
<article class="content" style="display: none;">
{% assign author_id = author[0] %}
{% assign author_name = author[1].name %}
{% assign author_posts = site.posts | where: "author", author_id %}
{% if author_posts.size > 0 %}
<h2 id="{{ author_id }}" class="box__title">#{{ author_name }}</h2>
<ul class="list">
{% for post in author_posts %}
<li class="vertical-item">
<a class="link link--animated" href="{{ post.url }}">{{ post.title }}</a> <span class="smaller"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%Y-%m-%d" }}</time> [{{ post.category }}]</span>
</li>
{% endfor %}
</ul>
{% endif %}
</article>
{% endfor %}
<script>
const authors = Array.from(document.querySelectorAll('.box__title'));
const authorId = window.location.hash.slice(1);
if (authorId) {
document.getElementById(authorId).parentElement.style.display = 'block';
} else {
authors.forEach(author => {
author.parentElement.style.display = 'block';
});
}
</script>
</section>