Skip to content

Windows build fails due to unsupported strftime("%-d") format in homepage template #13

Description

@ki-kyvos

Description

While building the OSSIE website on Windows, the build fails with the following exception:

ValueError: Invalid format string

The error originates from the homepage template:

{{ post.date.strftime('%B %-d, %Y') }}

The %-d format specifier is supported on Unix-like platforms but is not supported by Python's strftime() implementation on Windows.

As a result, mkdocs serve and mkdocs build fail on Windows.

Steps to Reproduce

  1. Clone the repository on Windows.
  2. Install the project dependencies.
  3. Run:
mkdocs serve

or

mkdocs build

Actual Result

The build fails with:

ValueError: Invalid format string

Expected Result

The website should build successfully on Windows, Linux, and macOS.

Possible Solution

Use a cross-platform date formatting approach instead of %-d.

One possible implementation is:

post.date.strftime("%B %d, %Y").replace(" 0", " ")

This preserves the existing output format (for example, July 3, 2026) while remaining compatible across Windows, Linux, and macOS.

Alternatively, another platform-independent formatting approach could be used if preferred.

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