Skip to content

Commit

Permalink
Fixed tags page (#17)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Bullrich authored May 12, 2024
1 parent cf8d122 commit 4daa0b1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/_includes/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
<link href="https://unpkg.com/[email protected]/themes/prism-okaidia.css" rel="stylesheet">
<script async defer data-website-id="3b2361f7-42d6-4950-ade3-6b0b6200426a"
src="https://umami.bullrich.dev/script.js" data-domains="codingbull.dev"></script>
{% if title %}
<title>{{ title }} - Coding Bull</title>
{% else %}
<title>Coding Bull</title>
{% endif %}
{% if image %}
<meta property="og:image" content="{{ image }}">
<meta name="twitter:image" content="{{ image }}">
Expand All @@ -29,7 +33,7 @@
</head>

<body>
<main tabindex="-1" id="main-content">{% block content %}{% endblock %}</main>
<main tabindex="-1" id="main-content" class="mb-4 lg:mb-12">{% block content %}{% endblock %}</main>
{% include "partials/footer.html" %}
{% mermaid_js %}
</body>
Expand Down
11 changes: 8 additions & 3 deletions src/_includes/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ <h3 class="text-4xl lg:text-6xl blog-title">{{ title }}</h3>
{{ content | safe }}
</div>
<div>
<h3 class="text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-tr from-accent to-base-content">Tag list</h3>
<h3 class="text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-tr from-accent to-base-content">
List of all available tags
</h3>
</div>
<ul class="list-none space-y-3 mt-6 text-3xl">

<ul class="list-none space-y-8 mt-6 text-3xl">
{% for tag in pagination.items %}
<li>
<a class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3" href="{{ '/tags/' | url }}{{ tag }}">#{{ tag }}</a>
<a class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3 my-2" href="{{ '/tags/' | url }}{{ tag }}">
#{{ tag }}
</a>
</li>
{% endfor %}
</ul>
Expand Down
8 changes: 6 additions & 2 deletions src/tags-feed.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
layout: "feed.html"
eleventyImport:
collections: ["tags"]
pagination:
data: collections
size: 100
size: 1
alias: tag
permalink: /tags/{{ tag }}/
description: Find all the posts with the tag.
eleventyComputed:
title: Tagged with "{{ tag }}"
description: Find all the posts with the tag "{{ tag }}"
---

# Posts using <span class="tag bg-base-300 hover:bg-primary rounded-xl py-1 px-3">#{{ tag }}</span>
2 changes: 1 addition & 1 deletion src/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ pagination:
data: collections.tagList
size: 100
alias: tag
permalink: /tags/
---
Find all the tags and search for posts based on that

0 comments on commit 4daa0b1

Please sign in to comment.