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

Fix: Allignment issue in the blog page #1029

Merged
merged 12 commits into from
Oct 26, 2024

Conversation

Ritesh2351235
Copy link
Contributor

What kind of change does this PR introduce?
Fix for the Blog page alignment bug and recover the banner image for the latest GSOD blog.

Issue Number:

Screenshots/videos:

Screenshot 2024-10-17 at 12 12 47 PM

Summary
Resized the author avatar sizes for more than 2 authors for a single blog which solves the banner issue and alignment issue.
Also changes the author name format for more than 2 authors on a single blog which could be seen in the image

Does this PR introduce a breaking change?
No

@Ritesh2351235 Ritesh2351235 requested a review from a team as a code owner October 17, 2024 06:57
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to the JSON Schema Community. Thanks a lot for creating your first pull request!! 🎉🎉 We are so excited you are here! We hope this is only the first of many! For more details check out README.md file.

@Ritesh2351235 Ritesh2351235 changed the title Fixing the allignment issue in the blog page Fix: Allignment issue in the blog page Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 8741790

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7ecd915) to head (8741790).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1029   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          373       373           
  Branches        94        94           
=========================================
  Hits           373       373           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Ritesh2351235
Copy link
Contributor Author

@benjagm Hey Benjamin I tried fixing the blog page alignment and banner image issue and I am successful while doing it in the local system however the build preview above using cloudfare does not align with my changes locally
How can I fix this issue ?

</>
) : (
frontmatter.authors.map(
(author: any, index: number) => (
Copy link
Member

Choose a reason for hiding this comment

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

here please use the correct data type in place of any

<>
{frontmatter.authors
.slice(0, 2)
.map((author: any, index: number) => (
Copy link
Member

Choose a reason for hiding this comment

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

please use the correct data type in place of any

@DhairyaMajmudar
Copy link
Member

Thank you for the PR @Ritesh2351235 its working well locally, left few suggestions.

@DhairyaMajmudar DhairyaMajmudar added the Hacktoberfest-accepted Pull requests accepted for Hacktoberfest'24 label Oct 17, 2024
@Ritesh2351235
Copy link
Contributor Author

Ritesh2351235 commented Oct 18, 2024

@DhairyaMajmudar Hey I,m getting some NextJS problems while building the project
I tried reckoning the website and starting the development server again but I failed
You could see the build results down in the github workflow

Screenshot 2024-10-18 at 9 37 45 AM

@Ritesh2351235
Copy link
Contributor Author

@DhairyaMajmudar To handle the type safety in typescript I have added the Author interface in the index.ts file which takes care of any type error.
Let me know if any further changes are required!!

Copy link
Member

@DhairyaMajmudar DhairyaMajmudar left a comment

Choose a reason for hiding this comment

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

Working great, LGTM 🚀

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

It seems that now we lost the other images in the other posts. Can you please check?

Screenshot 2024-10-18 at 19 58 09

@Ritesh2351235
Copy link
Contributor Author

@benjagm The changes i have made above are working totally fine on the local machine but are not working on the preview above in cloudfare.
Any suggestion how i could solve this error

@DhairyaMajmudar
Copy link
Member

Comment here can be helpful #1021 (comment)

@Ritesh2351235
Copy link
Contributor Author

@DhairyaMajmudar I made the necessary changes in the tailwind config file but again it's working fine locally but the build preview its not showing the required changes

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Good try, however we should try to avoid using the tailwind safelist that way.

Let's make sure we follow the best practices for avoid our styles to be purged:
https://v2.tailwindcss.com/docs/optimizing-for-production#writing-purgeable-html

@@ -4,6 +4,28 @@ module.exports = {
'./components/**/*.{js,ts,jsx,tsx,md}',
],
darkMode: "class",
safelist: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than adding elements to the safelist here we should check for other alternatives like making sure we are adding styles without using string concatenation to create class names:

https://v2.tailwindcss.com/docs/optimizing-for-production#writing-purgeable-html

@Ritesh2351235
Copy link
Contributor Author

@benjagm Thank you!!
The site is working fine now.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

I just left a comment to see if we can avoid using the tailwind safelist config.

Comment on lines 8 to 19
'h-8',
'w-8',
'h-11',
'w-11',
'bg-slate-50',
'rounded-full',
'-ml-3',
'bg-cover',
'bg-center',
'border-2',
'border-white',
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we sure we need to add this to the safelist? I think we can avoid this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the safelist from the tailwindconfig now
Its working fine!

@benjagm
Copy link
Collaborator

benjagm commented Oct 24, 2024

@Ritesh2351235 Can we implement the same change on the landing page? There is a preview of the last blog post, and it will be great to have the same behavior. As soon as we add this, we are ready to merge.

Screenshot 2024-10-24 at 07 52 43

Great job!

@Ritesh2351235
Copy link
Contributor Author

@benjagm I have corrected the Blog component of the Landing page which aligns similarly to the blog page.

@Ritesh2351235 Ritesh2351235 requested a review from benjagm October 24, 2024 06:30
@Ritesh2351235
Copy link
Contributor Author

Ritesh2351235 commented Oct 25, 2024

Hey @benjagm,
I found the same author error on the community page and have fixed it. I’ll be merging the code soon!

Previous
Screenshot 2024-10-25 at 10 16 43 PM

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Great job!

@benjagm benjagm merged commit 6b762a2 into json-schema-org:main Oct 26, 2024
12 of 14 checks passed
Copy link

Congratulations, @Ritesh2351235 for your first pull request merge in this repository! 🎉🎉. Thanks for your contribution to JSON Schema!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest-accepted Pull requests accepted for Hacktoberfest'24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug: Alignment issues and banner image missing at latest GSoD blog card
3 participants