<div class="card-columns">

{% assign annotations = site.data.annotations | group_by: "uri" %}

{% for document in annotations %}
<div class="card">
<div class="card-header">
	<a href="{{ document.name  }}">{{ document.items[0].document.title }}</a>
</div>

<ul class="list-group list-group-flush small">
{% for annotation in document.items %}

<li class="highlight list-group-item d-block">


{% for selector in annotation.target[0].selector %}
{% if selector.type == "TextQuoteSelector" %}
	<div class="exact">
		<p>
		{{ selector.prefix }} 
		<strong>{{ selector.exact }}</strong> 
		{{ selector.suffix }} 
		</p>
		</div>
{% endif %}
{% endfor %}

	<div class="comment-info">
		<strong>{{ annotation.user | replace: "acct:", "" | replace: "@hypothes.is", ""  }}<span class="text-muted">@hypothes.is</span></strong> - {{ annotation.updated | date_to_string  }} <a href="{{ annotation.links.incontext }}">#</a>
	</div>
	
	{% if annotation.text %}
	<div class="comment-body text-muted font-italic">
		{{ annotation.text | markdownify }}
	</div>
	{% endif %}

	<div class="tags">
	{% for tag in annotation.tags %}
		{% include badge.html name=tag %}  
	{% endfor %}
	</div>
</li>

{% endfor %}
</ul>

</div>
{% endfor %}
</div>
