8000 Comparing main...sort-date · adafruit/circuitpython-org · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adafruit/circuitpython-org
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: adafruit/circuitpython-org
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: sort-date
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 629 files changed
  • 1 contributor

Commits on Mar 21, 2024

  1. Check boards for valid dates, including blinka boards

    Previously a date was OK if it could be parsed; now it's only OK if
    frontmatter thinks it's a date. I'm not 100% that this is the same
    as jekyll, but we'll go with it for now.
    jepler committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    70866ae View commit details
    Browse the repository at this point in the history
  2. Rewrite all boards with a valid date_added

    This also reformats all front matter due to how the file is processed.
    
    The transformation was done with
    ```py
    import datetime
    import sys
    import frontmatter
    
    for i in sys.argv[1:]:
        post = frontmatter.load(i)
        date_added = post.get("date_added", "")
    
        if isinstance(date_added, str):
            try:
                date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d").replace(hour=12)
            except ValueError as exc:
                print(f"Failed to parse date {date_added} in {i}: {exc}")
        elif isinstance(date_added, datetime.date):
            date_added = datetime.datetime.combine(date_added, datetime.time(hour=12))
    
        post["date_added"] = date_added
    
        with open(i, "wb") as f:
            frontmatter.dump(post, f)
            f.write(b"\n") # Re-add trailing newline
    ```
    jepler committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    d3160e5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f84a859 View commit details
    Browse the repository at this point in the history
Loading
0