Create tag page, some more styling
This commit is contained in:
parent
3616eb0d95
commit
91fac7b4c7
@ -47,6 +47,9 @@ module.exports = function() {
|
||||
|
||||
return {
|
||||
notes,
|
||||
hashtags
|
||||
hashtags: Object.keys(hashtags).map(tag => ({
|
||||
tag,
|
||||
notes: hashtags[tag]
|
||||
}))
|
||||
};
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<title>{{ title | safe }}</title>
|
||||
<link rel="stylesheet" href="/styles/reset.css" />
|
||||
<link rel="stylesheet" href="/styles/main.css" />
|
||||
</head>
|
||||
|
@ -41,6 +41,8 @@ body {
|
||||
|
||||
main {
|
||||
height: 100%;
|
||||
max-width: var(--screen-lg);
|
||||
margin: 0 auto;
|
||||
padding: var(--space-size-m);
|
||||
}
|
||||
|
||||
|
25
src/tags.njk
Normal file
25
src/tags.njk
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
layout: base.njk
|
||||
pagination:
|
||||
data: notes.hashtags
|
||||
size: 1
|
||||
alias: hashtag
|
||||
eleventyComputed:
|
||||
permalink: "/tags/{{ hashtag.tag }}/"
|
||||
title: "#{{ hashtag.tag }}"
|
||||
---
|
||||
|
||||
<main>
|
||||
<h1>All notes for #{{ hashtag.tag }}</h1>
|
||||
|
||||
<ul>
|
||||
{% for note in hashtag.notes %}
|
||||
<li>
|
||||
<div>
|
||||
{{ note.text | md | safe }}
|
||||
|
||||
<a href="/notes/{{ note.id }}">Permalink</a>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</main>
|
Loading…
Reference in New Issue
Block a user