Commit Graph

12 Commits

Author SHA1 Message Date
Fries 60c2ac15e7 move asset stuff to its own crate
this should seperate out the asset handling code, which was practically
its own module inside the main codebase, into a little crate.
2023-07-12 22:10:08 -07:00
Fries f4e9ef6af9 seperate the hyperlegible font-face to a template
this lets me make the base html code cleaner and it lets me keep using a
seperate file for font-face stuff so the style.css is cleaner. this is
implemented by using the askama template engine with the same syntax
that was used in the style tag in base.html, but i render the template
to text instead of directly to a rocket responder and i hash it with the
sha2 crate. this hashing should only run once, at startup, so it
shouldn't be much of a performance hit.
2023-07-12 18:41:39 -07:00
Fries 53193d84b8 add cache busting filenames and split off assets
i abstraced the file handling out to a global static struct called
"Files" that is only written to once, in main inside a OnceLock. i also
split out asset handling into its own module folder called assets which
has all the asset handling code.

i also have a new crate called "proc_macros" which provides a attribute macro
that adds the base_template field to each struct i decorate with it
using the syn and quote crates.
2023-07-11 01:04:53 -07:00
Fries 6e9bbe1d60 add cors and previous and next name functions 2023-07-05 02:10:31 -07:00
Fries 79e88cb2f4 add a WIP index page 2023-07-03 23:59:56 -07:00
Fries 93bd3540e8 use async mutex
looks like the best way to do the state thing after all is global so i
should use async mutexes so stuff doesn't block.
2023-07-03 22:14:10 -07:00
Fries a672135793 add cursed hot reloading support
im sorry if you have to look at the sites.rs file.
2023-07-03 16:23:14 -07:00
Fries 9411e4a097 add a remove command and error handling to the cli 2023-06-30 23:12:55 -07:00
Fries c481999c55 add a work in progress cli and fix bugs
i'm making a cli that lets you add stuff to the names.json file and read
data from it and i moved stuff that can be shared between them like the
Site struct to a shared crate thats in workspace, like the cli crate. i
also switched to using typed json parsing which works well.
2023-06-30 21:43:18 -07:00
Mossfet c2fe292b2d Prepped code for names being defined at runtime in rocket() 2023-06-30 11:47:46 +01:00
Fries 5cbbacec23 use the askama compile time template engine
this has the exact same syntax as tera (jinja style) but its compile
time which is very useful for having a portable binary that doesn't
require any files to run like a templates folder or public folder.
2023-06-29 21:24:53 -07:00
Fries 9c3002a8d0 add a not found template and reorgainze the code
this commit does quite a bit as it adds a not found html template and it
reorganized the code entirely by splitting stuff into modules.
2023-06-29 19:45:41 -07:00