Skip to main content

normalize_separators

Function normalize_separators 

Source
pub fn normalize_separators(s: &str) -> String
Expand description

Normalize path separators to /.

moss treats \ as a path separator everywhere so content paths behave identically regardless of the authoring OS. Windows strip_prefix yields backslash-separated relative paths; left un-normalized they collapse nested page/asset URLs (every segment after the first is lost) and defeat the file watcher’s /.moss/ gate (causing a runaway rebuild loop). Literal backslashes in content filenames are therefore not supported — they are read as separators.