this adds a Cache-Control header to existing responses so they can be
cached in the browser. cache busting means this cache can be immutable
as if the file changes, the filename changes, so the browser will get
new files.
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.
the stylesheet got a new update from my websites stylesheet with the
bigger font sizes and i split the hyperlegible font face css into its
own file and made the asset code cleaner.
this means the watcher doesn't stop working if someone makes an edit to
names.json that results in a parser error. it will just print out the
error and keep the old configuration. if you restart the program and the
file still has an error, the program won't start.
i made printing less complicated by making printing both the name and
the url with the seperator the default option and using both those flags
at the same time should do the same thing as just printing without any
flags.
i also refactored commands into their own module folder with each
command getting their own file module.
this has abstractions for getting the names.json file and reading them
and parsing them. i also moved the cli logger initialization code into
its own module.
the cli now uses a new module in the shared crate, called directories
which is a module that has functions for directory stuff, mainly, it
uses the directories crate to have a portable way to have directories
for the application like data directories and config directories.
i also added logging to the shared and cli crates, so you can see debug
stuff with the RUST_LOG environment variable.
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.
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.
i added a json api called /name which lets you get the previous and next
site name. i also modified the internal url functions to return a None
value if overflow is turned off and next or previous is nothing.
you put your sites url into the url query and it should redirect you to
the next or previous site and it will overflow if you're the last or
first site in the array.