add an index page and add name functions to the API and cache busting #7

Merged
mossfet merged 7 commits from index-page into main 2023-07-11 11:08:08 +00:00
Member

i actually made the API work as intended by adding name functions to the API and i added an index page which just loops over the sites in the names.json file and links to them and the text will be the name of the site if it has a name, and if it doesn't, it will be the URL of the site.

i also added cache busting filenames which are filenames with a unique hash added onto them which means you can set a long time for the cache to stay valid and you can invalidate that by just changing the file as the file has a unique name based off its hash.

i actually made the API work as intended by adding name functions to the API and i added an index page which just loops over the sites in the names.json file and links to them and the text will be the name of the site if it has a name, and if it doesn't, it will be the URL of the site. i also added cache busting filenames which are filenames with a unique hash added onto them which means you can set a long time for the cache to stay valid and you can invalidate that by just changing the file as the file has a unique name based off its hash.
Fries added 4 commits 2023-07-10 06:30:43 +00:00
74f3cd1cb4 fix a bug with the next_name function
looks like i used the previous_name logic for element of the vector i
used which is wrong.
4e17ef7dff update stylesheet and clean up asset code
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.
Fries added 1 commit 2023-07-10 06:32:06 +00:00
Fries added 1 commit 2023-07-11 08:06:02 +00:00
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.
Fries changed title from add an index page and add name functions to the API to add an index page and add name functions to the API and cache busting 2023-07-11 08:07:29 +00:00
Fries added 1 commit 2023-07-11 09:38:58 +00:00
70bb0691d3 implement a CachedResponse Responder struct
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.
mossfet merged commit 50d92e998a into main 2023-07-11 11:08:08 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Solarpunk/meowy-webring#7
No description provided.