From 09ff8a742ee4ccb469745b9757e61d0447be5611 Mon Sep 17 00:00:00 2001 From: lqdev Date: Sun, 27 Aug 2023 14:50:46 +0200 Subject: [PATCH] navigation maps for navigating across pages --- Cargo.lock | 1 + README.md | 47 +++++++++ content/2023-08-20-under-construction.tree | 1 + content/about-treehouse.tree | 70 ++++++++++++- content/about.tree | 9 +- content/index.tree | 7 ++ content/secret.tree | 2 + crates/treehouse/Cargo.toml | 1 + crates/treehouse/src/cli/regenerate.rs | 102 ++++++++++++------ crates/treehouse/src/html/mod.rs | 1 + crates/treehouse/src/html/navmap.rs | 82 +++++++++++++++ crates/treehouse/src/html/tree.rs | 1 - crates/treehouse/src/state.rs | 4 +- static/js/tree.js | 116 +++++++++++++++------ template/tree.hbs | 9 +- 15 files changed, 382 insertions(+), 71 deletions(-) create mode 100644 README.md create mode 100644 content/secret.tree create mode 100644 crates/treehouse/src/html/navmap.rs diff --git a/Cargo.lock b/Cargo.lock index fd58a4f..2e16fb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,6 +1231,7 @@ dependencies = [ "pulldown-cmark", "rand", "serde", + "serde_json", "tokio", "toml_edit", "tower-http", diff --git a/README.md b/README.md new file mode 100644 index 0000000..049b372 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# liquidex's treehouse + +Welcome to the Construct. + +If you haven't seen the treehouse yet, you [may wanna](https://liquidex.house). It's pretty darn cool. + +Please note that this repository contains spoilers. So if you like exploring by yourself, you may wanna do that first before diving into the source code. + +*Spoilers for what?*, you might ask. + +… + +You have been warned. + +## Building + +To build the website: + +```sh +cargo run -p treehouse regenerate +``` + +This will spit out a directory `target/site` containing the static pages. You're free to use any HTTP server you wish, but for development purposes treehouse includes one in the CLI: + +```sh +cargo run -p treehouse regenerate --serve +``` + +This will fire up a server on port 8080. No way to change that, sorry. Edit the source code. + +If you're developing, you may wanna use [`cargo-watch`](https://crates.io/crates/cargo-watch): + +```sh +cargo watch -- cargo run -p treehouse regenerate --serve +``` + +The website will reload itself automatically if you change any file in the repository. + +## Contributing + +If you found a typo, be my guest. Just note that some typos are intentional, please make sure you understand the full context of the sentence. + +If you found a bug, by all means please submit a fix. (or at least an issue.) + +Since this is my personal website, I don't accept outside contributions for new content. Because then it would no longer be *my* treehouse. + +If you wish to create something similar to liquidex's treehouse, you probably want to use more mature software instead of my scrappy, opinionated piece of art. Check out [Logseq](https://logseq.com/) - it has static site generation built in, with a much more approachable UI, cross-device sync, and great customizability through community-made themes and plugins. diff --git a/content/2023-08-20-under-construction.tree b/content/2023-08-20-under-construction.tree index 5d90b4b..b03002c 100644 --- a/content/2023-08-20-under-construction.tree +++ b/content/2023-08-20-under-construction.tree @@ -1 +1,2 @@ +% id = "01H8V55MGHGYXWY8F287FMNXNY" - section under construction. sorry! in the meantime, maybe you wanna read [my ramblings about the treehouse][branch:01H89RFHCQCD3E1XS5XAPW86J5]? diff --git a/content/about-treehouse.tree b/content/about-treehouse.tree index e0be362..b7a38a0 100644 --- a/content/about-treehouse.tree +++ b/content/about-treehouse.tree @@ -111,7 +111,7 @@ - but you may not find the experience favorable % id = "01H89RFHCQ7HTZSP6P2RZR8JHE" - + but most importantly of all, it is *weird*. + + but most important of all, it is *weird*. % id = "01H89RFHCQTRVPZ0AJ0DGJHXKX" - weird as me @@ -131,11 +131,13 @@ % id = "01H89RFHCQ2GWJPTAKTRGS1QAC" - weird poems and philosophical talk are over, it's time to focus on the tech. + % id = "01H8V55APDEF8WTQ3KFC7E9HWB" - call this an overview, Defense of Design, or what have you % id = "01H89RFHCQF4N9T05B9DVWX67K" - treehouse is built in the programming language that gives me the most pleasure coding. + % id = "01H8V55APDXH5N1YC2WXDBCDN4" - no need for you to know more. :shhh: % id = "01H89RFHCQRA4BBBWDC8K68BB0" @@ -145,60 +147,80 @@ % id = "01H89RFHCQA32MCR4MDCANDNC7" - but being the altruist I am - don't worry, it _will_ be open source one day. + % id = "01H8V55APDHC0DZNF67DS76P8H" - in case you're reading this in the far future, and this is still here… you wouldn't mind [dropping me a line][branch:01H89P3CH8CD28KGX9GVRFK60E] would you? % id = "01H89RFHCQAQVXP6B2H0T8NNDS" - personally… the language you build a personal project with almost never matters. it's rather how you execute your ideas. + % id = "01H8V55APDRZHHG69A6BWQM8YE" + therefore I find boasting that my project is powered by a `$LANGUAGE` or a `$FRAMEWORK` unnecessary. + % id = "01H8V55APDNJ4W3MY1A204PHJ3" + but if you really care that much, it's built with Rust, plain HTML5, plain CSS, and [Vanilla JS](http://vanilla-js.com/). + % id = "01H8V55APDYHZG2QXQ78HZE97V" - (yes, I know that website is super old, but I still find it incredibly funny :hueh:) % id = "01H89RFHCQFWC2FWBAE9PVNC08" - as I alluded to [here][branch:01H89RFHCQ3EAP0F6PRSEK7S1T], treehouse is built to decay gracefully as you take away the fancy parts. + % id = "01H8V55APDMPF3WFTNTFSYBQRF" - you will be able to read it just fine without JavaScript, just that it'll be a little less pleasant. + % id = "01H8V55APD1RSSRMDZ3CEE9S9C" - that's because the JS handles stuff like lazy loading of linked trees. + % id = "01H8V55APDAPSR7R9M569GW4S7" - you may have seen a brief _"Loading…"_ text flash before your eyes as you opened this _about this_ branch - that's it downloading another tree and pasting it into this document + % id = "01H8V55APDS9BNC2TQ5S5VYC0G" - when JS is unavailable we fall back to a plain old `` link through a `