Skip to content

Commit 4daa0b1

Browse files
authored
Fixed tags page (#17)
Resolves #11 Fixed the tag page not rendering properly. It was a problem with the pagination value. Also fixed the title of the page not changing using the title property.
1 parent cf8d122 commit 4daa0b1

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

src/_includes/layouts/base.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
<link href="https://unpkg.com/[email protected]/themes/prism-okaidia.css" rel="stylesheet">
1111
<script async defer data-website-id="3b2361f7-42d6-4950-ade3-6b0b6200426a"
1212
src="https://umami.bullrich.dev/script.js" data-domains="codingbull.dev"></script>
13+
{% if title %}
14+
<title>{{ title }} - Coding Bull</title>
15+
{% else %}
1316
<title>Coding Bull</title>
17+
{% endif %}
1418
{% if image %}
1519
<meta property="og:image" content="{{ image }}">
1620
<meta name="twitter:image" content="{{ image }}">
@@ -29,7 +33,7 @@
2933
</head>
3034

3135
<body>
32-
<main tabindex="-1" id="main-content">{% block content %}{% endblock %}</main>
36+
<main tabindex="-1" id="main-content" class="mb-4 lg:mb-12">{% block content %}{% endblock %}</main>
3337
{% include "partials/footer.html" %}
3438
{% mermaid_js %}
3539
</body>

src/_includes/tags.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ <h3 class="text-4xl lg:text-6xl blog-title">{{ title }}</h3>
88
{{ content | safe }}
99
</div>
1010
<div>
11-
<h3 class="text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-tr from-accent to-base-content">Tag list</h3>
11+
<h3 class="text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-tr from-accent to-base-content">
12+
List of all available tags
13+
</h3>
1214
</div>
13-
<ul class="list-none space-y-3 mt-6 text-3xl">
15+
16+
<ul class="list-none space-y-8 mt-6 text-3xl">
1417
{% for tag in pagination.items %}
1518
<li>
16-
<a class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3" href="{{ '/tags/' | url }}{{ tag }}">#{{ tag }}</a>
19+
<a class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3 my-2" href="{{ '/tags/' | url }}{{ tag }}">
20+
#{{ tag }}
21+
</a>
1722
</li>
1823
{% endfor %}
1924
</ul>

src/tags-feed.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22
layout: "feed.html"
3+
eleventyImport:
4+
collections: ["tags"]
35
pagination:
46
data: collections
5-
size: 100
7+
size: 1
68
alias: tag
79
permalink: /tags/{{ tag }}/
8-
description: Find all the posts with the tag.
10+
eleventyComputed:
11+
title: Tagged with "{{ tag }}"
12+
description: Find all the posts with the tag "{{ tag }}"
913
---
1014

1115
# Posts using <span class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3">#{{ tag }}</span>

src/tags.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ pagination:
66
data: collections.tagList
77
size: 100
88
alias: tag
9+
permalink: /tags/
910
---
10-
Find all the tags and search for posts based on that

0 commit comments

Comments
 (0)