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

Article Routes #67

Merged
merged 17 commits into from
Nov 20, 2023
Merged

Article Routes #67

merged 17 commits into from
Nov 20, 2023

Conversation

Woozl
Copy link
Member

@Woozl Woozl commented Nov 13, 2023

This initial template for the individual article pages. These should be generated at build time or incrementally generated with ISR. I have set up the initial fetching for each page, the routes look like this to the user:

/news/2023/11/13/article-title-as-slug

Currently this is done using a catch-all route and not using the first three route segments (the date). However, I'd like the user to be able to visit a route for each day/month/year and view a list of articles:

image

I'm currently still trying to determine the best way to add this functionality:

  1. building this functionality into the catch-all and conditionally rendering the UI based on if it's a grouping page or an article page
  2. having nested dynamic routes (i.e., nested folders in the pages directory) and managing the different UIs in each file (potentially with a shared layout component for the group types of year, month, and day).

@Woozl
Copy link
Member Author

Woozl commented Nov 14, 2023

After exploring both options, using the nested dynamic routes seems more flexible. I have added a TimeGrouping UI component (components/news/time-grouping.js) to be used in [year]/index.js, [month]/index.js, and [day]/index.js, so that logic isn't repeated.

image

@Woozl Woozl marked this pull request as ready for review November 20, 2023 21:45
Copy link
Collaborator

@suejinkim20 suejinkim20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@Woozl
Copy link
Member Author

Woozl commented Nov 20, 2023

Here are some good example articles:

Multiple images: http://localhost:3000/news/2023/6/5/renci-strengthens-storm-surge-response-capabilities
Subtitle, rich markdown: http://localhost:3000/news/2023/7/11/data-matters-short-course-series-returns-in-august-2023
A lot of tagged items: http://localhost:3000/news/2022/1/31/drone-projects-take-data-processing-and-communication-to-new-heights

Couple things @suejinkim20 or I noticed:

  • some of the really long tags overflow on small screens (I attempted fixing this, but the wrapping <a> tag seems to mess up the text-overflow: ellipsis css)
  • We need to get subtitles under the images
  • some spacing and general layout fixes

@Woozl
Copy link
Member Author

Woozl commented Nov 20, 2023

However, I'm going to go ahead and merge this and create the appropriate issues.

@Woozl Woozl merged commit aef6d66 into develop Nov 20, 2023
@Woozl Woozl deleted the feature/article-route-pages branch November 20, 2023 21:58
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.

2 participants