mirror of
https://github.com/zyllian/webdog.git
synced 2025-05-11 02:56:38 -07:00
fix builds without serve feature
This commit is contained in:
parent
c0a5d06074
commit
c653c3554e
3 changed files with 13 additions and 13 deletions
|
@ -18,7 +18,7 @@ use warp::{
|
|||
Filter,
|
||||
};
|
||||
|
||||
use crate::{Site, SiteBuilder, PAGES_PATH, ROOT_PATH, SASS_PATH, TEMPLATES_PATH};
|
||||
use crate::{util::get_name, Site, SiteBuilder, PAGES_PATH, ROOT_PATH, SASS_PATH, TEMPLATES_PATH};
|
||||
|
||||
fn with_build_path(
|
||||
build_path: PathBuf,
|
||||
|
@ -26,16 +26,6 @@ fn with_build_path(
|
|||
warp::any().map(move || build_path.clone())
|
||||
}
|
||||
|
||||
/// Helper to get the "name" of a path.
|
||||
pub fn get_name(path: &Path) -> (PathBuf, String) {
|
||||
let name = path.with_extension("");
|
||||
let name_str = name
|
||||
.display()
|
||||
.to_string()
|
||||
.replace(std::path::MAIN_SEPARATOR, "/");
|
||||
(name, name_str)
|
||||
}
|
||||
|
||||
/// Helper to make a path relative.
|
||||
fn rel(path: &Path, prefix: &Path) -> Result<PathBuf, std::path::StripPrefixError> {
|
||||
Ok(path.strip_prefix(prefix)?.to_owned())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue