reorganize template processor, implement new server options, optimize component init arguments

This commit is contained in:
yggverse 2025-06-25 00:42:22 +03:00
parent 60f702b3d1
commit b93f389304
9 changed files with 126 additions and 61 deletions

View file

@ -23,14 +23,37 @@ pub struct Config {
#[arg(short, long, default_value_t = String::from("ei"))]
pub debug: String,
/// Absolute path to the template files directory
#[arg(short, long)]
pub template: Option<String>,
/// Absolute path to the public files directory
#[arg(short, long)]
pub public: String,
/// Absolute path to the `Access denied` template file
#[arg(long)]
pub template_access_denied: Option<String>,
/// Absolute path to the `Internal server error` template file
#[arg(long)]
pub template_internal_server_error: Option<String>,
/// Absolute path to the `Not found` template file
#[arg(long)]
pub template_not_found: Option<String>,
/// Absolute path to the `Welcome` template file.
/// Unlike `template_index`, this applies only to the `public` location
///
/// **Patterns**
/// * `{list}` - entries list for the `public` directory
#[arg(long)]
pub template_welcome: Option<String>,
/// Absolute path to the `Index` template file for each directory
///
/// **Patterns**
/// * `{list}` - entries list for the current directory
#[arg(long)]
pub template_index: Option<String>,
/// Optimize memory usage on reading large files or stream
#[arg(short, long, default_value_t = 1024)]
pub read_chunk: usize,