Crawler v0.3.1 Crawler.Linker.PathPrefixer
Returns prefixes (../
s) according to the given URL’s structure.
Link to this section Summary
Functions
Returns prefixes (../
s) according to the given URL’s structure
Link to this section Functions
Link to this function
prefix(current_url)
Returns prefixes (../
s) according to the given URL’s structure.
Examples
iex> PathPrefixer.prefix("https://hello.world/")
"../"
iex> PathPrefixer.prefix("https://hello.world/page.html")
"../"
iex> PathPrefixer.prefix("https://hello.world/page")
"../../"
iex> PathPrefixer.prefix("https://hello.world/dir/page.html")
"../../"
iex> PathPrefixer.prefix("https://hello.world/dir/page")
"../../../"