Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add *Tags* index page #871

Merged
merged 3 commits into from
Nov 16, 2024

Conversation

straight-shoota
Copy link
Member

This is a follow-up to #711 adding an index for all the tags.
Previously, tags were only shown on each post and there are individual pages for each tag showing the tagged posts. This patch adds an overview page listing all tags.
This is useful even just as an internal editing tool 😛

Tags with most articles are ordered on top.
The most recent three articles per tag are rendered, and a link to the tag page.

grafik

@straight-shoota straight-shoota self-assigned this Nov 14, 2024
@straight-shoota straight-shoota marked this pull request as ready for review November 14, 2024 20:36
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for crystal-website ready!

Name Link
🔨 Latest commit bc9debb
🔍 Latest deploy log https://app.netlify.com/sites/crystal-website/deploys/673660dd9f365b000867be7e
😎 Deploy Preview https://deploy-preview-871--crystal-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@beta-ziliani beta-ziliani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

section: tags
---

{% capture counts_with_tags_string %}{% for tag in site.tags %}{{ tag[1] | size | prepend:"000000" | slice:-6,6 }}:{{ tag[0] }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really there isn't a better way to format a number?? 😮

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Apparently not 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can, but that would need to write a template helper function.

Copy link
Member Author

@straight-shoota straight-shoota Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course with a plugin we could make this cleaner. Probably not worth the effort though.

@straight-shoota straight-shoota merged commit fd23e09 into crystal-lang:master Nov 16, 2024
5 checks passed
@straight-shoota straight-shoota deleted the feat/tags-page branch November 16, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants