Skip to content

Support date prefixes in blog posts #1999

@emmadesilva

Description

@emmadesilva

Feature Specification: Date Prefixes for Blog Post Publish Dates

Current Functionality: The application supports ordering documentation pages within the sidebar using numerical prefixes.

New Functionality: Support setting the blog post publish dates using date-based prefixes for blog posts.

Requirements:

  1. Date Format: Support date prefixes in the format YYYY-MM-DD (e.g., 2024-11-05) as defined in the ISO 8601 standard. Optionally support YYYY-MM-DD-HH-MM for more granular ordering.

  2. Prefix Stripping: The date prefix must be removed from the route key, mirroring the behavior of numerical prefixes for documentation pages.

  3. Front Matter Integration:

    • The extracted date from the prefix should be used to populate the date field in the blog post's front matter.
    • If the date is explicitly defined in the front matter, it should take precedence over the date extracted from the prefix. This behavior should be consistent with the existing documentation prefix feature.
  4. Markdown Post Specificity: This feature should only apply to MarkdownPost types.

  5. Zero-Padding: While zero-padding (e.g., using 05 instead of 5 for the day) is highly encouraged in the documentation, the system should be robust enough to handle date prefixes that omit leading zeros. Zero padding should be required

Examples:

Basic Date Prefixes:

  • 2024-11-05-my-first-post.md
  • 2024-11-06-another-post.md
  • 2024-11-10-yet-another-post.md

Detailed Date Prefixes:

  • 2024-11-05-10-30-my-first-post.md
  • 2024-11-06-14-45-another-post.md
  • 2024-11-10-09-00-yet-another-post.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions