Conversation
|
There was a problem hiding this comment.
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 %}"> |
There was a problem hiding this comment.
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> | ||
|
|
There was a problem hiding this comment.
[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> |
There was a problem hiding this comment.
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.