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

Add [future]/[expired] to future/expired posts #1140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

foosel
Copy link

@foosel foosel commented Jan 22, 2023

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:

Screenshot_20230122_134801_Firefox

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.
  • I have enabled maintainer edits for this PR.
  • 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.
  • This change does not include any CDN resources/links.
  • 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.

@sonarcloud
Copy link

sonarcloud bot commented Jan 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@LNA-DEV
Copy link

LNA-DEV commented Oct 1, 2023

Hey. What is the status here? Would be awesome to have this feature^^

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.

Add [future]/[expired] to future/expired blog posts
3 participants