diff --git a/Justfile b/Justfile
index 7cc2557..e9915ae 100644
--- a/Justfile
+++ b/Justfile
@@ -1,7 +1,7 @@
port := "8080"
serve:
- cargo watch -- cargo run -- serve --port {{port}}
+ RUST_BACKTRACE=1 cargo watch -- cargo run -- serve --port {{port}}
fix:
cargo run -- fix-all --apply
diff --git a/content/about.tree b/content/about/v2.tree
similarity index 100%
rename from content/about.tree
rename to content/about/v2.tree
diff --git a/content/index.dj b/content/index.dj
new file mode 100644
index 0000000..2fdb873
--- /dev/null
+++ b/content/index.dj
@@ -0,0 +1,37 @@
+title = "riki's house"
+include_feed = { name = "new", title = "Blog" }
+
++++
+
+My name's *riki moe*, or *リキ萌*!
+
+I'm a _he/him_-type cat [furry][page:philosophy/furry] doing various things with computers.
+
+I work on game optimization tools at [[CD PROJEKT RED](https://cdprojektred.com) :rarog:]{.nowrap} but that's just the tip of the iceberg!
+After hours, I program [websites](/), [compilers][def:stitchkit/repo], [audio][def:dawd3/repo], and other fun things.
+
+Such as [*video games.*][page:games]
+Like, I probably wouldn't be in the industry if I didn't like them.\
+My personal favourites are [:nap: [DELTARUNE](https://deltarune.com)]{.nowrap}, [:bean: [Animal Well](https://www.animalwell.net/)]{.nowrap}, [:fox: [TUNIC](https://tunicgame.com/)]{.nowrap}, [:hueh: [A Hat in Time](https://hatintime.com)]{.nowrap}, and [:propane: [Noita](https://noitagame.com/)]{.nowrap}.
+But also many many more, because I'm really indecisive.
+
+Or [*music.*][page:music]
+I [listen to a lot of it.][def:social/bandcamp]
+And I mean, [_a lot_.][def:social/listenbrainz]
+A metric fuck tonne.\
+I'm a huge fan of electronic genres, but also jazz and (alternative) rock from time to time.\
+I listen to [_Songs About My Cats_](https://venetiansnares.bandcamp.com/album/songs-about-my-cats) while coding.\
+My favourite artists are [C418](https://c418.bandcamp.com/album/excursions), [The Flashbulb](https://theflashbulb.bandcamp.com/album/kirlian-selections), [Aphex Twin](https://aphextwin.bandcamp.com/album/drukqs), [Squarepusher](https://squarepusher.bandcamp.com/album/ultravisitor), and [False Noise](https://upscalehq.bandcamp.com/album/floral-strobe).
+
+I kinda also [make music sometimes](https://daknus.bandcamp.com) when I feel like it.
+
+I also drew a bit of dawing (...do a bit of drawing), as evidenced by the floofee on this page.
+
+If all that sounds like an interesting bunch of words...
+
+- feel free to email me: `hi` at this domain!!
+- or add me on Discord---the nickname's *rikimoe*.
+
+I like to think I'm pretty amicable in person but I'm uh, also really socially awkward...!\
+~Please excuse any social awkwardness that may ensue from you contacting me.\
+Or me contacting you.~
diff --git a/content/index.tree b/content/index.tree
index 7f437f2..5e7245f 100644
--- a/content/index.tree
+++ b/content/index.tree
@@ -73,10 +73,6 @@ visibility = "Private"
- I'd like to make some new friends!
if you wanna meet me, email `hi` at this domain.
-% id = "about"
- content.link = "about"
-+ ## [``{=html}][page:kuroneko]{.secret}me
-
% id = "programming"
content.link = "programming"
+ ## ``{=html}programming
diff --git a/src/config.rs b/src/config.rs
index 48fe361..c55cba2 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -152,6 +152,8 @@ impl Config {
}
pub fn page_url(&self, page: &str) -> String {
+ // We don't want .dj appearing in URLs, though it exists as a disambiguator in [page:] links.
+ let page = page.strip_suffix(".dj").unwrap_or(page);
format!("{}/{}", self.site, page)
}
diff --git a/src/generate.rs b/src/generate.rs
index 7ea0bce..3caa73e 100644
--- a/src/generate.rs
+++ b/src/generate.rs
@@ -1,5 +1,6 @@
mod atom;
mod dir_helper;
+mod doc;
mod include_static_helper;
mod simple_template;
mod tree;
@@ -7,6 +8,7 @@ mod tree;
use std::{ops::ControlFlow, sync::Arc};
use atom::FeedDir;
+use chrono::{DateTime, Utc};
use dir_helper::DirHelper;
use handlebars::{handlebars_helper, Handlebars};
use include_static_helper::IncludeStaticHelper;
@@ -18,13 +20,14 @@ use crate::{
dirs::Dirs,
fun::seasons::Season,
generate::{
+ doc::DocDir,
simple_template::SimpleTemplateDir,
tree::{DirIndex, TreehouseDir},
},
sources::Sources,
vfs::{
- self, layered_dir, AnchoredAtExt, Cd, Content, ContentCache, Dir, DynDir, Entries,
- HtmlCanonicalize, MemDir, Overlay, ToDynDir, VPath, VPathBuf,
+ self, layered_dir, AnchoredAtExt, Cd, Content, ContentCache, Dir, DynDir, HtmlCanonicalize,
+ MemDir, ToDynDir, VPath, VPathBuf,
},
};
@@ -54,8 +57,10 @@ fn create_handlebars(site: &str, static_: DynDir) -> Handlebars<'static> {
let mut handlebars = Handlebars::new();
handlebars_helper!(cat: |a: String, b: String| a + &b);
+ handlebars_helper!(iso_date: |d: DateTime write!(out, " and in the link text,
- // but preserve other formatting such as bold, italic, code, etc.
- jotdown::Event::Start(
- jotdown::Container::Link(_, _) | jotdown::Container::Heading { .. },
- _
- ) | jotdown::Event::End(
- jotdown::Container::Link(_, _) | jotdown::Container::Heading { .. }
- )
- )
- })
- .cloned()
- .collect();
- let mut title = String::new();
- let _render_diagnostics = djot::Renderer {
- config: &sources.config,
- dirs,
- treehouse: &sources.treehouse,
- file_id,
-
- // How. Just, stop.
- page_id: "liquidex-you-reeeeeal-dummy".into(),
- }
- .render(&title_events, &mut title);
-
- let link = events.iter().find_map(|(event, _)| {
- if let jotdown::Event::Start(jotdown::Container::Link(link, link_type), _) = event {
- Some(link_url(sources, dirs, link, *link_type))
- } else {
- None
- }
- });
-
- return ParsedEntry {
- title: (!title.is_empty()).then_some(title),
- link,
- };
- }
- }
-
- ParsedEntry {
- title: None,
- link: None,
- }
-}
-
-fn link_url(sources: &Sources, dirs: &Dirs, url: &str, link_type: jotdown::LinkType) -> String {
- if let jotdown::LinkType::Span(jotdown::SpanLinkType::Unresolved) = link_type {
- if let Some(url) = resolve_link(&sources.config, &sources.treehouse, dirs, url) {
- return url;
- }
- }
- url.to_owned()
-}
-
/// Extremely simple HTML renderer without the treehouse's fancy branch folding and linking features.
fn branches_to_html_simple(
s: &mut String,
diff --git a/src/generate/doc.rs b/src/generate/doc.rs
new file mode 100644
index 0000000..eda596f
--- /dev/null
+++ b/src/generate/doc.rs
@@ -0,0 +1,242 @@
+use std::{
+ fmt::{self},
+ sync::Arc,
+};
+
+use anyhow::Context;
+use chrono::{DateTime, Utc};
+use handlebars::Handlebars;
+use serde::{Deserialize, Serialize};
+use tracing::{error, instrument};
+
+use crate::{
+ dirs::Dirs,
+ generate::BaseTemplateData,
+ html::djot,
+ sources::Sources,
+ state::{report_diagnostics, toml_error_to_diagnostic, FileId, TomlError},
+ tree::{attributes::Picture, feed},
+ vfs::{Content, Dir, Query, VPath},
+};
+
+#[derive(Default, Deserialize)]
+struct Attributes {
+ /// Template to use for generating the page.
+ /// Defaults to `_tree.hbs`.
+ #[serde(default)]
+ template: Option
1 {
- write!(out, r#" start="{}""#, start)?;
+ write!(out, r#" start="{start}""#)?;
}
if let Some(ty) = match numbering {
Decimal => None,
@@ -172,7 +157,7 @@ impl<'a> Writer<'a> {
RomanLower => Some('i'),
RomanUpper => Some('I'),
} {
- write!(out, r#" type="{}""#, ty)?;
+ write!(out, r#" type="{ty}""#)?;
}
}
}
@@ -182,7 +167,7 @@ impl<'a> Writer<'a> {
}
Container::DescriptionList => out.push_str("
out.push_str("
out.push_str("
"),
Container::TableRow { .. } => out.push_str(""),
Container::Section { .. } => {}
@@ -455,7 +440,7 @@ impl<'a> Writer<'a> {
}
out.push_str(" {}
@@ -193,7 +178,7 @@ impl<'a> Writer<'a> {
}
out.push_str(" out.push_str(" out.push_str("