.. 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")
```
47 lines
2.1 KiB
Markdown
47 lines
2.1 KiB
Markdown
---
|
||
layout: download
|
||
board_id: "raspberry_pi_4b"
|
||
title: "Raspberry Pi 4 Model B Download"
|
||
name: "Pi 4 Model B"
|
||
manufacturer: "Raspberry Pi"
|
||
board_url:
|
||
- "https://www.raspberrypi.com/products/raspberry-pi-4-model-b/"
|
||
board_image: "raspberry_pi_4b.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-24
|
||
features:
|
||
- Wi-Fi
|
||
- Bluetooth/BLE
|
||
- Ethernet
|
||
- HDMI/DisplayPort
|
||
- 40-pin GPIO
|
||
- USB 3.0
|
||
---
|
||
|
||
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing better! And what could make the Pi 4 better than the 3? How about a faster processor, USB 3.0 ports, and updated Gigabit Ethernet chip with PoE capability? Good guess - that's exactly what they did!
|
||
|
||
The Raspberry Pi 4 is the latest product in the Raspberry Pi range, boasting an updated 64-bit quad core processor running at 1.4GHz with built-in metal heatsink, USB 3 ports, dual-band 2.4GHz and 5GHz wireless LAN, faster (300 mbps) Ethernet, and PoE capability via a separate PoE HAT.
|
||
|
||
- Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
|
||
- 1GB, 2GB or 4GB LPDDR4-2400 SDRAM (depending on model)
|
||
- 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
|
||
- Gigabit Ethernet
|
||
- 2 USB 3.0 ports; 2 USB 2.0 ports.
|
||
- Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
|
||
- 2 × micro-HDMI ports (up to 4kp60 supported)
|
||
- 2-lane MIPI DSI display port
|
||
- 2-lane MIPI CSI camera port
|
||
- 4-pole stereo audio and composite video port
|
||
- H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
|
||
- OpenGL ES 3.0 graphics
|
||
- Micro-SD card slot for loading operating system and data storage
|
||
- 5V DC via USB-C connector (minimum 3A)
|
||
- 5V DC via GPIO header (minimum 3A)
|
||
- Power over Ethernet (PoE) enabled (requires separate PoE HAT)
|
||
- Operating temperature: 0 – 50 degrees C ambient
|
||
- A good quality 2.5A power supply can be used if downstream USB peripherals consume less than 500mA in total.
|
||
|
||
## Purchase
|
||
* [Adafruit](https://www.adafruit.com/product/4295)
|