Crawler v0.3.0 Crawler.Linker.PathPrefixer

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

Link to this section Summary

Link to this section Functions

Link to this function prefix(current_url)

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