Currently the themes are really crap in the python server.
Okay not crap, but they don't serve the purpose I want.
So, instead of just pointing to a custom theme directory for the single program.
How about it reads the domain host from the request, and the theme depends on that.
File path would look like this
```tree
Ephemeral/
themes/
example.com/
...
example2.com/
...
cz0.au/
...
```
This means each website can have a completely independant theme, and if you put each server behind cloudflare, you would never really know that they're running on the same server.
Additionally, I'll have to add file uploading in a similar way. where there is a domain under `files/` that organises uploaded files.
...
...
@@ -33,20 +13,6 @@ Wanted:
- File viewcount in x time (seconds, minutes, ...)
- Extension Viewcount in x time (seconds, minutes, ...)
## Options
Problem: I can't seem to tell it to select a different template depending on the HOST header.
Why: I need to show a different website template for different domain names being served.
Potential Fix 1:
Setup a new template engine for each web request, render and then exit - the "template" directory can be different each time, depending on the HOST header!
Potential Fix 2:
Render ALL templates for all possible domains, needing a different function for each domain.
Potential Fix 3:
There's a way to get it working, but im not smart enough to figure it out.
Templating is hard. I want the template engine to be able to dynamically pick the template, depending on the `HOST` header per request.
It seems like rust has primary support for compile-time templates, but I've found one called [Ramhorns](https://crates.io/crates/ramhorns) which seems to be promising.
Templates are saved in the `/templates/` directory, **but** not quite.
Each site has it's own template, and that is a subdirectory of the `/templates/` directory, it is named after the `HOST` header.
```tree
Ephemeral/
themes/
localhost/
...
example.com/
...
cz0.au/
...
```
This allows the single server to seamlessly host multiple sites, all /completely/ different from eachother.
But not quite!! - Files are still stored with no real domain specification (except in db, but that could be slow), So I'll have to implement a file separation by doing the same thing I've done with the templates.
## Problem: how?????
Problem: I can't seem to tell it to select a different template depending on the HOST header.
Why: I need to show a different website template for different domain names being served.
Potential Fix 1:
Setup a new template engine for each web request, render and then exit - the "template" directory can be different each time, depending on the HOST header!
Potential Fix 2:
Render ALL templates for all possible domains, needing a different function for each domain.
Potential Fix 3:
There's a way to get it working, but im not smart enough to figure it out.
Potentical Fix 4:
Use a template engine that actually fits my requirements.