-
Notifications
You must be signed in to change notification settings - Fork 0
Disable reading time on TIL posts #16
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
Conversation
|
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.
Pull Request Overview
This PR disables the reading time display (clock icon and duration) for TIL (Today I Learned) posts by adding CSS rules that hide these elements when displayed on TIL-related pages or sections.
- Adds conditional CSS styling to hide reading time elements on TIL posts
- Implements the hiding functionality in both section and individual page templates
- Uses CSS
display: none !importantto ensure the clock icon and reading time text are not visible
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| templates/section.html | Adds CSS to hide reading time on TIL section pages with conditional class application |
| templates/page.html | Adds CSS to hide reading time on individual TIL pages based on path detection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| </style> | ||
|
|
||
| <div class="section-content{% if section.title == 'TILs' or 'til' in section.slug %} tils-section{% endif %}"> |
Copilot
AI
Aug 30, 2025
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.
The condition 'til' in section.slug will always evaluate to True because it's not properly grouped with the first condition. It should be (section.title == 'TILs') or ('til' in section.slug) to work as intended.
| <div class="section-content{% if section.title == 'TILs' or 'til' in section.slug %} tils-section{% endif %}"> | |
| <div class="section-content{% if (section.title == 'TILs') or ('til' in section.slug) %} tils-section{% endif %}"> |
| <style> | ||
| .tils-section .muted svg.i-clock, | ||
| .tils-section .muted svg.i-clock+span { | ||
| display: none !important; | ||
| } | ||
| </style> | ||
|
|
Copilot
AI
Aug 30, 2025
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.
[nitpick] Inline styles in templates should be avoided. Consider moving this CSS to a separate stylesheet or using a more maintainable approach like CSS classes that can be conditionally applied.
| <style> | |
| .tils-section .muted svg.i-clock, | |
| .tils-section .muted svg.i-clock+span { | |
| display: none !important; | |
| } | |
| </style> |
| <style> | ||
| .muted svg.i-clock, | ||
| .muted svg.i-clock+span { | ||
| display: none !important; | ||
| } | ||
| </style> |
Copilot
AI
Aug 30, 2025
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.
This CSS rule is duplicated between templates/section.html and templates/page.html. Consider extracting this to a shared CSS file or creating a reusable template block to avoid code duplication.
| <style> | |
| .muted svg.i-clock, | |
| .muted svg.i-clock+span { | |
| display: none !important; | |
| } | |
| </style> | |
| {% include "shared/muted-clock-style.html" %} |
No description provided.