.. leading zeros are required for `frontmatter` to treat them as dates
rather than strings, apparently per the YAML specification.
This was done by script:
```py
import re
import datetime
import pathlib
import sys
import frontmatter
rx = re.compile(r'^(\s*)date_added:.*$', re.M)
for path_str in sys.argv[1:]:
print(path_str)
path = pathlib.Path(path_str)
post = frontmatter.load(path)
date_added = post.get("date_added", "")
if isinstance(date_added, datetime.date):
continue
if isinstance(date_added, str):
try:
date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d")
except ValueError as exc:
print(f"Failed to parse date {date_added} in {path_str}: {exc}")
continue
date_added = date_added.date()
content = path.read_text("utf-8")
new_content = rx.sub(lambda m: f"{m.group(1)}date_added: {date_added}", content)
assert content != new_content
path.write_text(new_content, "utf-8")
```
33 lines
1.3 KiB
Markdown
33 lines
1.3 KiB
Markdown
---
|
|
layout: download
|
|
board_id: "raspberry_pi_zero"
|
|
title: "Raspberry Pi Zero Download"
|
|
name: "Zero"
|
|
manufacturer: "Raspberry Pi"
|
|
board_url:
|
|
- "https://www.raspberrypi.com/products/raspberry-pi-zero/"
|
|
board_image: "raspberry_pi_zero.jpg"
|
|
download_instructions: "https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi"
|
|
downloads_display: true
|
|
blinka: true
|
|
date_added: 2019-06-17
|
|
features:
|
|
- HDMI/DisplayPort
|
|
- 40-pin GPIO
|
|
---
|
|
|
|
At first glance, the Pi Zero isn't much. It just looks like a slimmed down version of the Raspberry Pi we know and love. But when we started to think of the possibilities - and what a well-chosen set of accessories could add - we realized the appeal. And then we saw the price...could it be true? Yes!
|
|
|
|
This is the slimmest, most pared down Raspberry Pi to date. It's kind of like the little cousin to the Pi 2 - with just a micro SD card slot, a mini HDMI port, two micro USB ports (one for power, one for USB), and 512MB of RAM. It has a single-core 1 GHz processor chip, similar to the Pi A+ and B+.
|
|
|
|
- 1GHz single-core CPU
|
|
- 512MB RAM
|
|
- Mini HDMI port
|
|
- Micro USB OTG port
|
|
- Micro USB power
|
|
- HAT-compatible 40-pin header
|
|
- Composite video and reset headers
|
|
- CSI camera connector (v1.3 only)
|
|
|
|
## Purchase
|
|
* [Adafruit](https://www.adafruit.com/product/2885)
|