-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
1. Fixed at 4 recommended numbers 2. Fix image alt not correct
678aca2
to
bf3778b
Compare
@@ -508,7 +508,6 @@ bundle = false | |||
# 相关文章推荐配置 | |||
[page.related] | |||
enable = true | |||
count = 5 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It defaults to displaying 5, but only displays 3 at the maximum page width
- Almost no one pulls the scrollbar to browse more, the scrollbar is meaningless
- 4 relate items in 800px, it will look more beautiful.
- This recommendation algorithm is very rough, making it meaningless for users to choose to configure the number of recommendations
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
DoIt/assets/css/_partial/_single/_related.scss
Lines 81 to 100 in ba650e8
@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; | |
} |
before style
current style