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

Feature Request: View count for the posts #4

Open
GeraltO18 opened this issue Jun 14, 2024 · 1 comment
Open

Feature Request: View count for the posts #4

GeraltO18 opened this issue Jun 14, 2024 · 1 comment

Comments

@GeraltO18
Copy link

Hi @mark-horn,

I went through the space nano blog and it has the view count for each blog. It's interesting to see those stats, would it be possible to do the same here in the nano? If yes, I would be happy to take it up and would like to have your insights on developing it.

Thanks.

@markhorn-dev
Copy link
Owner

I probably won't do it with Nano, because one of my goals for the project was to keep it fully static / minimal.

I can point you in the right direction though.

Previously I used React and Supabase to accomplish a page counter.

You'll need to make a fetch request to your database and increment your count / fetch your count per each slug in your blog.

Keep in mind if you do this in Astro in SSG mode (nano is built SSG) it will only fetch at build time and won't update until your next build. You'll likely want to change to SSR (server rendered). Then on the server you can make your crud operations and update the page before it's served to the client.

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

No branches or pull requests

2 participants