View Source Crawler.Linker.PathPrefixer (Crawler v1.5.0)

Returns prefixes (../s) according to the given URL's structure.

Summary

Functions

Returns prefixes (../s) according to the given URL's structure.

Functions

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")
"../../../"