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

News Posts load when scrolling down #356

Open
Naviary2 opened this issue Dec 3, 2024 · 0 comments
Open

News Posts load when scrolling down #356

Naviary2 opened this issue Dec 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Naviary2
Copy link
Member

Naviary2 commented Dec 3, 2024

Don't load all news posts at once, but automatically load more the more you scroll down the page.

Benefit: As the number of news posts grow, if we want to not have to worry about the news page growing in kilobytes, we won't have to delete old news post.

Overview of how to add:

  1. Write an API route on the server that will send the response with ~5 news posts after a date provided in the request.

  2. Compile a small/compact script that the client-side can use that will convert markdown to html. Right now we have an npm package that can do that server-side, but I'm sure we can find a script off the internet in which we can grab to enable client-side as well!
    OR- an alternative option: Convert the news post markdown to html before we serve them to the client! We could do this either at the time of the request, or during build so that they are all pre-converted into html (that's probably more efficient)
    The choice of route will come down to how large the markdown-to-html converter script IS, IF we are able to find one for the client, and compare that to the extra size introduced by sending them html instead of a smaller markdown file.

  3. Write a script for the news page that, when we scroll to the bottom of the page, will fetch that API request we created to retrieve more news posts, and use the above markdown-to-html converter to append them to the document!

  4. Copy and paste the spinny pawn animation at the bottom of the page while the API request is in progress.

@Naviary2 Naviary2 added the enhancement New feature or request label Dec 3, 2024
@Naviary2 Naviary2 changed the title Unlimited News Posts News Posts load when scrolling down Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant