Skip to content

News Posts load when scrolling down #356

@Naviary2

Description

@Naviary2

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions