.. 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")
```
1.3 KiB
1.3 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | bootloader_id | features | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| download | lolin_c3_pico | LOLIN C3 Pico Download | LOLIN C3 Pico | Wemos |
|
lolin_c3_pico.jpg | 2023-05-24 | esp32c3 | lolin_c3_pico |
|
A mini Wi-Fi & Bluetooth LE board based on ESP32-C3FH4.
Features
- based ESP32-C3 WIFI & Bluetooth LE RISC-V Single-Core CPU
- Type-C USB
- 4MB Flash
- Lolin I2C Port (does not match QWIIC/Stemma-Qt pinout)
- RGB LED (IO7)
- Clock speed: 160 Mhz
- 12x Digital IO
- ADC, I2C, SPI, UART
- Size: 25.4 mm x 25.4 mm
- Weight: 2.6g
- Compatible with LOLIN D1 mini shields
- Compatible with MicroPython, Arduino and ESP-IDF
- Default firmware: MicroPython