Switched front-matter from TOML to YAML as that makes a bit more sense
This commit is contained in:
parent
8f554e5c2e
commit
0e9af4f540
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
type = "Project"
|
project:
|
||||||
url = "git.huizinga.dev/Dreaded_X/automation_rs"
|
url: git.huizinga.dev/Dreaded_X/automation_rs
|
||||||
title = "Home Automation"
|
title: Home Automation
|
||||||
---
|
---
|
||||||
|
|
||||||
I have slowly been converting my house into my very own smart home!
|
I have slowly been converting my house into my very own smart home!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
type = "Project"
|
project:
|
||||||
url = "git.huizinga.dev/Dreaded_X/car-stereo"
|
url: git.huizinga.dev/Dreaded_X/car-stereo
|
||||||
title = "Car Stereo"
|
title: Car Stereo
|
||||||
---
|
---
|
||||||
|
|
||||||
My Peugeot 207 only has bluetooth for calling, so I decided it would be fun to build my own bluetooth receiver using the [ESP32] microcontroller.
|
My Peugeot 207 only has bluetooth for calling, so I decided it would be fun to build my own bluetooth receiver using the [ESP32] microcontroller.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
type = "Project"
|
project:
|
||||||
url = "git.huizinga.dev/Dreaded_X/pico_p1"
|
url: git.huizinga.dev/Dreaded_X/pico_p1
|
||||||
title = "Pico P1"
|
title: Pico P1
|
||||||
---
|
---
|
||||||
|
|
||||||
This is my most recent project, as I had recently decided to pick up a [Raspberry Pi Pico W] just to play around with.
|
This is my most recent project, as I had recently decided to pick up a [Raspberry Pi Pico W] just to play around with.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
type = "Project"
|
project:
|
||||||
url = "git.huizinga.dev/Z80/Z80"
|
url: git.huizinga.dev/Z80/Z80
|
||||||
title = "Z80 Computer"
|
title: Z80 Computer
|
||||||
---
|
---
|
||||||
|
|
||||||
The first big hardware project that I worked on was building a computer, from the ground up, around the [Z80] microprocessor.
|
The first big hardware project that I worked on was building a computer, from the ground up, around the [Z80] microprocessor.
|
||||||
|
|
26
tool/Cargo.lock
generated
26
tool/Cargo.lock
generated
|
@ -31,7 +31,7 @@ checksum = "1cf2fb99fac0b821a4e61c61abff076324bb0e5c3b4a83815bbc3518a38971ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"toml",
|
"yaml-rust",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -40,6 +40,12 @@ version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linked-hash-map"
|
||||||
|
version = "0.5.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.6.1"
|
version = "2.6.1"
|
||||||
|
@ -150,15 +156,6 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "toml"
|
|
||||||
version = "0.5.11"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
|
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tool"
|
name = "tool"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -217,3 +214,12 @@ name = "winapi-x86_64-pc-windows-gnu"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "yaml-rust"
|
||||||
|
version = "0.4.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
|
||||||
|
dependencies = [
|
||||||
|
"linked-hash-map",
|
||||||
|
]
|
||||||
|
|
|
@ -9,7 +9,7 @@ edition = "2021"
|
||||||
anyhow = "1.0.75"
|
anyhow = "1.0.75"
|
||||||
dotenvy = "0.15.7"
|
dotenvy = "0.15.7"
|
||||||
gray_matter = { version = "0.2.6", features = [
|
gray_matter = { version = "0.2.6", features = [
|
||||||
"toml",
|
"yaml",
|
||||||
], default-features = false }
|
], default-features = false }
|
||||||
regex = "1.9.4"
|
regex = "1.9.4"
|
||||||
serde = { version = "1.0.188", features = ["derive"] }
|
serde = { version = "1.0.188", features = ["derive"] }
|
||||||
|
|
|
@ -4,13 +4,13 @@ use std::{
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use gray_matter::{engine::TOML, Matter};
|
use gray_matter::{engine::YAML, Matter};
|
||||||
use regex::{Captures, Regex};
|
use regex::{Captures, Regex};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(rename_all = "snake_case")]
|
||||||
enum FrontMatter {
|
enum FrontMatter {
|
||||||
Project { title: String, url: String },
|
Project { title: String, url: String },
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_latex() -> anyhow::Result<()> {
|
fn generate_latex() -> anyhow::Result<()> {
|
||||||
let matter = Matter::<TOML>::new();
|
let matter = Matter::<YAML>::new();
|
||||||
|
|
||||||
let prefix = Path::new("../markdown");
|
let prefix = Path::new("../markdown");
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ fn generate_readme() -> anyhow::Result<()> {
|
||||||
let mut contents = String::new();
|
let mut contents = String::new();
|
||||||
file.read_to_string(&mut contents)?;
|
file.read_to_string(&mut contents)?;
|
||||||
|
|
||||||
let matter = Matter::<TOML>::new();
|
let matter = Matter::<YAML>::new();
|
||||||
|
|
||||||
let re = Regex::new(r"\#\{(.*)\}").expect("Regex should be valid");
|
let re = Regex::new(r"\#\{(.*)\}").expect("Regex should be valid");
|
||||||
let contents = re.replace_all(&contents, |caps: &Captures| {
|
let contents = re.replace_all(&contents, |caps: &Captures| {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user