Commit 9a374f8f authored by Leon Byford's avatar Leon Byford

improved tags

parent 2f5b97c6
---
layout: post
title: A look back at the Golden Age of Detective Fiction
tags: [books]
excerpt_separator: <!-- more -->
---
......
......@@ -298,6 +298,10 @@ div#archive-link {
text-align: center;
}
div.tag-posts:target {
background-color: $ldjbDarkerBlue;
}
// Settled on moving the import of syntax highlighting to the bottom of the CSS
// ... Otherwise it really bloats up the top of the CSS file and makes it difficult to find the start
@import "highlights";
......
---
layout: page
title: Browse posts by tag
---
{% assign sortedTags = site.tags | sort %}
{% for tag in sortedTags %}
{% assign thisTag = tag | first %}
<div class="tag-posts" id="{{thisTag|uri_escape}}">
<h3>{{thisTag}}</h3>
<ul>
{% assign thisTagsPosts = site.posts | where_exp: "post", "post.tags contains thisTag" %}
{% for post in thisTagsPosts %}
<li {% if post.date > site.time %}class="future" {% endif %}data-pubdate="{{post.date|date: "%F"}}"><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a> ({{ post.date | date: "%F" }})</li>
{% endfor %}
</ul>
</div>
{% endfor %}
<script>
document.querySelectorAll("li.future").forEach(
post => {post.dataset.pubdate <= new Date().toISOString()
&& (post.style.display = "list-item");}
);
var lastTenKeys = [null, null, null, null, null, null, null, null, null, null];
var konamiCode = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"];
addEventListener("keydown", e => {
lastTenKeys.shift();
lastTenKeys.push(e.key);
if (JSON.stringify(lastTenKeys) == JSON.stringify(konamiCode)) {
document.querySelectorAll("li.future").forEach(
post => {post.style.display = "list-item";}
);
}
});
</script>
---
layout: page
title: Browse posts by tag
---
{% for tag in site.tags %}
{% assign thisTag = tag | first %}
### {{thisTag}}
{% assign thisTagsPosts = site.posts | where_exp: "post", "post.tags contains thisTag" %}
{% for post in thisTagsPosts %}
* [{{post.title}}]({{post.url}}) ({{ post.date | date: "%F" }})
{% endfor %}
{% endfor %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment