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

WIP: Refactor relate page #1371

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wu0407
Copy link
Contributor

@wu0407 wu0407 commented Oct 18, 2024

  1. Fixed at 4 recommended numbers
  2. Fix image alt not correct

before style
image

current style
image

Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
do-it ✅ Ready (Inspect) Visit Preview Nov 4, 2024 11:45am

1. Fixed at 4 recommended numbers
2. Fix image alt not correct
@@ -508,7 +508,6 @@ bundle = false
# 相关文章推荐配置
[page.related]
enable = true
count = 5
Copy link
Owner

Choose a reason for hiding this comment

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

I am not sure about this change. Why do you think it's a better idea to fix recommendation count to 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. It defaults to displaying 5, but only displays 3 at the maximum page width
  2. Almost no one pulls the scrollbar to browse more, the scrollbar is meaningless
  3. 4 relate items in 800px, it will look more beautiful.
  4. This recommendation algorithm is very rough, making it meaningless for users to choose to configure the number of recommendations

Copy link
Owner

Choose a reason for hiding this comment

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

I imagine configuring the count to 2 or 3 makes sense equally. The 800px argument does not hold on mobile, where maybe only one recommendation can fit on screen and you will need to handle the overflow with a scrollbar anyway.

Copy link
Contributor Author

@wu0407 wu0407 Oct 22, 2024

Choose a reason for hiding this comment

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

Dynamically adapt to screen width,maybe change from 4 to 3 would be more appropriate for 800px.

@media (max-width: 768px) {
.related-container {
grid-template-columns: repeat(2, 1fr);
padding: 0.5rem;
}
.related-title {
font-size: 1rem;
}
}
@media (max-width: 480px) {
.related-container {
grid-template-columns: 1fr;
gap: 0.5rem;
}
.related-title {
font-size: 0.9rem;
}

@HEIGE-PCloud HEIGE-PCloud marked this pull request as draft October 21, 2024 12:11
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