Commit Graph

57 Commits

Author SHA1 Message Date
Tom Alexander
3867f965d2 Add a dependency manager for render-time actions.
This will be used for supporting things like copying static files or rendering code blocks like gnuplot or graphviz.
2025-02-08 17:29:09 -05:00
Tom Alexander
5cac44c625 Store the path to the original source file in the blog post object. 2025-02-07 21:08:06 -05:00
Tom Alexander
884a28e63a Remove pointless copying.
All checks were successful
format Build format has succeeded
rust-test Build rust-test has succeeded
clippy Build clippy has succeeded
2024-10-19 17:28:50 -04:00
Tom Alexander
1c3e2ca4d9 Remove the last use of walkdir. 2024-10-19 17:26:37 -04:00
Tom Alexander
2081d25066 Remove a use of WalkDir. 2024-10-19 17:14:05 -04:00
Tom Alexander
7ddc4011b3 Use a type alias for read file results. 2024-10-19 17:03:52 -04:00
Tom Alexander
379850fe3d Use the deep path as the post id. 2024-10-19 16:55:38 -04:00
Tom Alexander
8ab69e480e Case insensitive match for org file extension. 2024-10-19 16:38:29 -04:00
Tom Alexander
c5621212bc Using multi-level deep folders successfully but the output is still shallow. 2024-10-19 16:35:45 -04:00
Tom Alexander
b9f74b7eca Write the filter to find the highest folders containing org documents. 2024-10-19 16:25:54 -04:00
Tom Alexander
493adb4688 Switch to iterative instead of recursive. 2024-10-19 16:15:23 -04:00
Tom Alexander
b6cc7a70b7 Future is not send. 2024-10-18 21:29:15 -04:00
Tom Alexander
8868cfb63f Don't need to hard-code static lifetime. 2024-10-18 21:23:22 -04:00
Tom Alexander
ae3add9c81 Fixed recursion using a BoxFuture. 2024-10-18 21:22:39 -04:00
Tom Alexander
98fa43575d Require boxing?. 2024-10-18 21:19:40 -04:00
Tom Alexander
5d3a6c4174 Also infinite. 2024-10-18 21:15:23 -04:00
Tom Alexander
be467c8074 infinite recursion? 2024-10-18 21:13:50 -04:00
Tom Alexander
0da375c529 Add a function to recursively list all entries in a directory with tokio. 2024-10-18 21:05:29 -04:00
Tom Alexander
eb67327574 Do not error if posts directory does not exist.
All checks were successful
build-natter Build build-natter has succeeded
format Build format has succeeded
rust-clippy Build rust-clippy has succeeded
rust-test Build rust-test has succeeded
2023-12-23 17:14:31 -05:00
Tom Alexander
8905c9356b Add a build for regular non-blog-post pages from org source. 2023-12-23 16:55:49 -05:00
Tom Alexander
138d694b27 Copy static files over to the output directory. 2023-12-23 15:45:23 -05:00
Tom Alexander
397d4ea0bc Fix clippy issues.
All checks were successful
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
build-natter Build build-natter has succeeded
format Build format has succeeded
2023-12-23 07:08:06 -05:00
fluxcdbot
df339f20fa CI: autofix rust code.
Some checks failed
rust-clippy Build rust-clippy has failed
rust-test Build rust-test has succeeded
format Build format has succeeded
2023-12-23 01:46:40 +00:00
Tom Alexander
35dff5cdaf Rename to natter. 2023-12-21 19:28:31 -05:00
Tom Alexander
2e1c979127 Add a prefix to footnote IDs.
This avoids a conflict with multiple blog posts rendering in the same stream.
2023-12-19 18:01:54 -05:00
Tom Alexander
261fe8a1a2 Fix the links to the blog posts. 2023-12-19 16:49:46 -05:00
Tom Alexander
add267d616 Switch over to using the render context in render calls. 2023-12-19 16:20:12 -05:00
Tom Alexander
cbe2010407 Invoke dust to render the stream pages.
At this point the render_blog_stream function is done, but RenderBlogStream::new needs to be implemented to actually generate the render context. The body of this function should be similar to convert_blog_post_page_to_render_context.
2023-12-17 17:26:15 -05:00
Tom Alexander
2ba4a5e3d7 Generate newer and older links. 2023-12-17 17:16:26 -05:00
Tom Alexander
c3482cf1e4 Chunking the blog posts for the stream. 2023-12-17 16:57:37 -05:00
Tom Alexander
fdf84e3d0b Finding the index page. 2023-12-17 15:45:50 -05:00
Tom Alexander
e8ed4a4f4a Initial structure for rendering a blog post stream. 2023-12-17 15:32:07 -05:00
Tom Alexander
884215a7e1 Writing the stylesheets to the output folder. 2023-12-17 13:46:47 -05:00
Tom Alexander
20c55f0708 Loading stylesheets from the default environment. 2023-12-17 12:43:47 -05:00
Tom Alexander
e3b5f7f74f Rename blog_post module to intermediate.
This module is mostly the intermediate representation of the AST, so the renaming is to make that more clear. The three forms are parsed => intermediate => render.

Parsed comes from Organic and is a direct translation of the org-mode text.

Intermediate converts the parsed data into owned values and does any calculations that are needed on the data (for example: assigning numbers to footnotes.)

Render takes intermediate and translates it into the format expected by the dust templates. The processing in this step should be minimal since all the logic should be in the intermediate step.
2023-10-27 13:10:21 -04:00
Tom Alexander
31a3efe417 Only print the contexts.
This allows us to pipe the output to jq to see the context easier. We can see the rendered output in the files written to disk.
2023-10-24 00:51:28 -04:00
Tom Alexander
3ac7826d2c Move the logic into convert_blog_post_page_to_render_context.
I was writing it in the build command's rust files for convenience, but now its getting long enough to warrant moving it into its final location.
2023-10-23 22:10:26 -04:00
Tom Alexander
178ce877bc Render the head for the page. 2023-10-23 21:51:15 -04:00
Tom Alexander
2b6f86d4e9 Switch to rendering blog post pages instead of blog posts. 2023-10-23 20:30:43 -04:00
Tom Alexander
199621b6f1 Remove the separation of the main template.
I don't think this is necessary, and it certainly isn't necessary at this level.
2023-10-22 18:39:05 -04:00
Tom Alexander
586fd8a066 Getting rendered output from duster. 2023-10-22 18:31:56 -04:00
Tom Alexander
043cc5eda4 I think I have worked around the lifetime issue by keeping references to the intermediate str's. 2023-10-22 18:12:45 -04:00
Tom Alexander
ce0819e85b Feeding the templates into the renderer integration. 2023-10-22 17:31:12 -04:00
Tom Alexander
fc5342adce Make the renderer a bit more generic. 2023-10-22 16:40:58 -04:00
Tom Alexander
24bac982f1 Starting to create the renderer integrations.
These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
Tom Alexander
5f34cb2dd5 Creating a SiteRenderer struct to handle the logic for invoking dust. 2023-10-22 16:10:41 -04:00
Tom Alexander
0b6900eeca Serialize the RenderBlogPost to JSON.
This struct still does not contain anything, but I'm just setting up the skeleton for this code.
2023-10-22 16:01:42 -04:00
Tom Alexander
a0c5b2d852 Don't use walkdir for getting the post directories.
We are only iterating a single level of depth anyway, so read_dir is enough.
2023-10-22 14:49:08 -04:00
Tom Alexander
a9fbb4cd63 Get the output directory and clear it. 2023-10-22 14:40:59 -04:00
Tom Alexander
07e4209048 Setting the post id based on the folder name. 2023-10-22 13:50:11 -04:00