uptane.github.io icon indicating copy to clipboard operation
uptane.github.io copied to clipboard

Feature Request: Automate Blog Post Updates on Homepage

Open Abhijay007 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

Currently, updating the latest blog posts on the homepage necessitates manual intervention, involving the tedious process of editing a JSON file. This manual update procedure is prone to errors and inefficiencies. To streamline this process and ensure timely updates, we aim to implement an automated workflow. By automating the task of fetching and updating new blog posts, we can enhance productivity and accuracy. This workflow automation will not only simplify the maintenance process but also ensure that our homepage consistently reflects the latest content.

Describe how you would like this problem to be resolved

Both PostgreSQL and Apache APISIX have implemented similar approaches on their sites. We can examine their methods and consider implementing a similar solution for our website.

Here are the resources for their implementations:

Apache APISIX Website Github: HomeEventsSection.tsx Apache APISIX Website: https://apisix.apache.org/ PostgreSQL AI Website Implementation: blog.js PostgreSQL AI Website: https://postgres.ai/

Abhijay007 avatar Feb 02 '24 18:02 Abhijay007

@Abhijay007 assign this issue to me

shubhusion avatar Jun 05 '24 19:06 shubhusion

@shubhusion go ahead

Abhijay007 avatar Jun 07 '24 02:06 Abhijay007

Solution 1: API-Based Approach

Overview:

In this approach, the latest blog posts are fetched from an API endpoint, providing real-time updates and scalability.

Steps to Implement:

  1. Setup API Endpoint: Develop an API endpoint to serve the latest blog posts, returning necessary data fields.
  2. Fetch Data from API in Frontend: Modify the homepage component to fetch blog posts from the API using React or similar technology.
  3. Display the Blog Posts: Design a responsive frontend to dynamically display fetched blog posts.

Solution 2: JSON-Based Approach

Overview:

In this approach, the latest blog posts are stored in a JSON file, updated periodically by a script.

Steps to Implement:

  1. Automate JSON File Update: Create a script to fetch and update the JSON file with the latest blog posts, handling errors gracefully.
  2. Fetch Data from JSON in Frontend: Modify the homepage component to fetch blog posts from the JSON file using React or similar technology.
  3. Display the Blog Posts: Design a responsive frontend to dynamically display fetched blog posts.

I have come up with these two solutions to solve the above issue and would like to know your preference. @Abhijay007

shubhusion avatar Jun 15 '24 19:06 shubhusion

Solution 1: API-Based Approach

Overview:

In this approach, the latest blog posts are fetched from an API endpoint, providing real-time updates and scalability.

Steps to Implement:

  1. Setup API Endpoint: Develop an API endpoint to serve the latest blog posts, returning necessary data fields.
  2. Fetch Data from API in Frontend: Modify the homepage component to fetch blog posts from the API using React or similar technology.
  3. Display the Blog Posts: Design a responsive frontend to dynamically display fetched blog posts.

Solution 2: JSON-Based Approach

Overview:

In this approach, the latest blog posts are stored in a JSON file, updated periodically by a script.

Steps to Implement:

  1. Automate JSON File Update: Create a script to fetch and update the JSON file with the latest blog posts, handling errors gracefully.
  2. Fetch Data from JSON in Frontend: Modify the homepage component to fetch blog posts from the JSON file using React or similar technology.
  3. Display the Blog Posts: Design a responsive frontend to dynamically display fetched blog posts.

I have come up with these two solutions to solve the above issue and would like to know your preference. @Abhijay007

@shubhusion Both approaches seem fine to me, but what is more important is determining what can work for us. In the issue above, I shared a few resources. You can follow those resources to implement this feature. Also, it would be great if you could make a PR and demo the implementation with that PR

Abhijay007 avatar Jun 17 '24 05:06 Abhijay007