mirror of
https://github.com/clowzed/sero
synced 2026-03-14 12:45:50 +01:00
implemented clean urls
This commit is contained in:
parent
4d7c7468dc
commit
405f8ad6fa
2 changed files with 13 additions and 1 deletions
|
|
@ -138,6 +138,17 @@ impl SitesService {
|
|||
path: String,
|
||||
connection: &T,
|
||||
) -> Result<Option<(bool, std::path::PathBuf)>, SiteServiceError> {
|
||||
let parsed_path = PathBuf::from(&path);
|
||||
|
||||
let path = match parsed_path.extension() {
|
||||
Some(_) => path,
|
||||
None => parsed_path
|
||||
.with_extension("html")
|
||||
.to_str()
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
};
|
||||
|
||||
let files = subdomain
|
||||
.find_related(FileEntity)
|
||||
.filter(FileColumn::UserPath.is_in([&path, "404.html"]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue