Installation
Still developing.
If available in Hex, the package can be installed as:
-
Add sitemap to your list of dependencies in
mix.exs:
def deps do
[{:sitemap, ">= 0.0.0"}]
end- Ensure sitemap is started before your application:
def application do
[applications: [:sitemap]]
endUsage
Basic
defmodule Sitemaps do
use Sitemap
create do
add "path1", priority: 0.5, changefreq: "hourly", expires: nil, mobile: true
end
ping
endAs a function
defmodule Sitemaps do
use Sitemap
def generate do
create do
add "path1", priority: 0.5, changefreq: "hourly", expires: nil, mobile: true
end
ping
end
endWith Ecto
a
bChange options.
Change option( use statement )
defmodule Sitemaps do
use Sitemap, compress: false, create_index: true
create do
add "path1", priority: 0.5, changefreq: "hourly"
add "path2", priority: 0.5, changefreq: "hourly"
end
ping
endChange option( create function's option )
defmodule Sitemaps do
use Sitemap
create compress: false, create_index: true do
add "path1", priority: 0.5, changefreq: "hourly"
add "path2", priority: 0.5, changefreq: "hourly"
end
ping
end