.. 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.2 KiB
1.2 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | features | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| download | bast_pro_mini_m0 | Bast Pro Mini M0 Download | Bast Pro Mini M0 | Electronic Cats |
|
bast_pro_mini_m0.jpg | 2019-04-13 | atmel-samd |
|
The Bast Pro Mini M0 features a powerful SAMD21E chip, an ARM Cortex-M0 based microcontroller with low power consumption and high performance, making it ideal for endless applications.
Technical details
- Microcontroller Arm Cortex-M0 ATSAMD21E18A with 48 MHz
- Flash Memory 256 KB
- SRAM Memory 32 KB
- Operating Voltage 3.5 – 6 V
- 12 Digital I/O Pins
- 10 PWM Digital I/O Pins
- 6 Analog Input Pins
- DC Current per I/O Pin 10 mA
- 1 built-in LED (
GPIO13) - Dimensions: 32 mm x 18 mm
- Weight 3 g