.. 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")
```
37 lines
1.4 KiB
Markdown
37 lines
1.4 KiB
Markdown
---
|
||
layout: download
|
||
board_id: "raspberry_pi_zerow"
|
||
title: "Raspberry Pi Zero W Download"
|
||
name: "Zero W"
|
||
manufacturer: "Raspberry Pi"
|
||
board_url:
|
||
- "https://www.raspberrypi.com/products/raspberry-pi-zero-w/"
|
||
board_image: "raspberry_pi_zerow.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:
|
||
- Wi-Fi
|
||
- Bluetooth/BLE
|
||
- HDMI/DisplayPort
|
||
- 40-pin GPIO
|
||
---
|
||
|
||
If you didn't think that the Raspberry Pi Zero could possibly get any better, then boy do we have a pleasant surprise for you! The new Raspberry Pi Zero W offers all the benefits of the Pi Zero v1.3, but with one big difference – built-in WiFi!
|
||
|
||
More specifically, this giant upgrade is the addition of a BCM43143 WiFi chip BUILT-IN to your Raspberry Pi Zero – just like the Pi 3! No more pesky WiFi adapters - this Pi is WiFi ready. There’s also Bluetooth Low Energy (BLE) on board making the Pi an excellent IoT solution (BLE support is still in the works, software-wise).
|
||
|
||
- 1GHz, single-core CPU
|
||
- 512MB RAM
|
||
- Mini HDMI and USB On-The-Go ports
|
||
- Micro USB power
|
||
- HAT-compatible 40-pin header
|
||
- Composite video and reset headers
|
||
- CSI camera connector
|
||
- 802.11 b/g/n wireless LAN
|
||
- Bluetooth 4.1
|
||
- Bluetooth Low Energy (BLE)
|
||
|
||
## Purchase
|
||
* [Adafruit](https://www.adafruit.com/product/3400)
|