Skip to content

feat: add views counter post #331

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FzFStormZ
Copy link

This is my first collaboration. Any advices to create better Pull requests are welcomed

This feature add a static views counter for every post in the blog. They only appeared when you open one of the post.
Most of the code is from this post: Add Views Counter to your Astro Blog Posts.

I just modify a little bit of his code to integrate it aside the words and minutes counters (and try to respect the icon system).

I also use the i18n to translate the word "views" for every language but, the only one translated is English. So, if some people want to help me to use the correct translation for every languages, it would be cool 😎

You can see the result on the image below:
image

Copy link

vercel bot commented Mar 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuwari-yags ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 4:36pm

@L4Ph
Copy link
Collaborator

L4Ph commented Mar 5, 2025

This code relies too heavily on external APIs.
In particular, I think relying on CORS proxies is not a good idea.

@Hasenpfote
Copy link
Contributor

This is an interesting feature! However, I noticed that the count increases with each browser refresh, which might make it less reliable as a metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants