.. 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")
```
35 lines
No EOL
1.1 KiB
Markdown
35 lines
No EOL
1.1 KiB
Markdown
---
|
|
layout: download
|
|
board_id: "m5stack_atom_u"
|
|
title: "AtomU ESP32 Download"
|
|
name: "AtomU ESP32"
|
|
manufacturer: "M5Stack"
|
|
board_url:
|
|
- "https://docs.m5stack.com/en/core/atom_u"
|
|
board_image: "m5stack_atom_u.jpg"
|
|
date_added: 2023-01-31
|
|
family: esp32
|
|
tags:
|
|
- Atom U
|
|
features:
|
|
- Wi-Fi
|
|
- USB-C
|
|
- Bluetooth/BTLE
|
|
---
|
|
|
|
ATOM U is a compact low-power consumption speech recognition IoT development kit. It adopts an ESP32 chipset, equipped with 2 low-power Xtensa 32-bit LX6 microprocessors with the main frequency of up to 240MHz. Built-in USB-A interface, IR emitter, programmable RGB LED. Plug-and-play, easy to upload and download programs. Integrated Wi-Fi and digital microphone SPM1423(I2S) for the clear sound record. suitable for HMI, Speech-to-Text (STT).
|
|
|
|
### Features
|
|
- ESP32-PICO-D4 (2.4GHz Wi-Fi dual mode)
|
|
- Integrated programmable RGB LED and button
|
|
- Compact design
|
|
- Built-in IR emitter
|
|
- Expandable pinout and GROVE port
|
|
|
|
## Documentation
|
|
|
|
* [AtomU ESP32](https://docs.m5stack.com/en/core/atom_u)
|
|
|
|
## Purchase
|
|
|
|
* [M5Stack](https://shop.m5stack.com/collections/m5-controllers/products/atomu-esp32-development-kit-with-usb-a) |