hugo-PaperMod
hugo-PaperMod copied to clipboard
Add [future]/[expired] to future/expired posts
What does this PR change? What problem does it solve?
This PR adds [future] and [expired] labels to the post title in listings/single entry view, similarly to the existing [draft] logic.
Those labels will show up next to affected posts, if they are rendered (hugo -F -E was used). Helps to visually distinguish these post types during editing, just like [draft] does.
Example:

Logic is
- future: Date is set and after now
- expired: ExpiryDate is set and before now
If there's any way to get this determined directly by Hugo I'd love to use that instead, however I couldn't find something as convenient as .Draft for either future or expired state (still a very Hugo newbie).
Was the change discussed in an issue or in the Discussions before?
Closes #1119
PR Checklist
- [ ] This change adds/updates translations and I have used the template present here.
- [x] I have enabled maintainer edits for this PR.
- [x] I have verified that the code works as described/as intended.
- [ ] This change adds a Social Icon which has a permissive license to use it.
- [x] This change does not include any CDN resources/links.
- [x] This change does not include any unrelated scripts such as bash and python scripts.
- [ ] This change updates the overridden internal templates from HUGO's repository.
Hi @foosel, I am thinking of using icons instead of text to represent the status. This is to overcome translations for these strings in future.
-
Draft - https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aedit_note%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048

-
Expired - https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aevent_busy%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048

-
Future - https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aevent_upcoming%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048

licensing: https://developers.google.com/fonts/faq#can_i_use_any_font_in_a_commercial_product
Hey. What is the status here? Would be awesome to have this feature^^







