cleaned up

This commit is contained in:
gyoder 2025-07-05 16:17:58 -06:00
parent 010bb99c9b
commit 88b22b4e77
5 changed files with 35 additions and 61 deletions

View file

@ -1,17 +1,11 @@
use std::env;
use std::fs;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use super::render::execute_lua;
use super::render::expand_template;
use anyhow::Result;
use kuchikiki::{
NodeRef,
traits::TendrilSink,
};
use kuchikiki::traits::TendrilSink;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};
pub fn serve_content(request_uri: &str) -> Result<String>{
pub fn serve_content(request_uri: &str) -> Result<String> {
// TODO: read from config
let pages = PathBuf::from("/var/www/htmlua/pages");
let components = PathBuf::from("/var/www/htmlua/components");
@ -28,12 +22,3 @@ pub fn serve_content(request_uri: &str) -> Result<String>{
Ok(executed_doc.to_string())
}
fn html_escape(input: &str) -> String {
input
.replace('&', "&amp;")
.replace('<', "&lt;")
.replace('>', "&gt;")
.replace('"', "&quot;")
.replace('\'', "&#x27;")
}