Current section
36 Versions
Jump to
Current section
36 Versions
Compare versions
4
files changed
+19
additions
-23
deletions
| @@ -23,4 +23,4 @@ | |
| 23 23 | [{<<"app">>,<<"xml_builder">>}, |
| 24 24 | {<<"optional">>,false}, |
| 25 25 | {<<"requirement">>,<<">= 0.0.0">>}]}]}. |
| 26 | - {<<"version">>,<<"0.1.0">>}. |
| 26 | + {<<"version">>,<<"0.1.1">>}. |
| @@ -1,14 +1,14 @@ | |
| 1 1 | defmodule Sitemap.Config do |
| 2 2 | defstruct [ |
| 3 | - :max_sitemap_files, # max sitemap links per index file |
| 4 | - :max_sitemap_links, # max links per sitemap |
| 5 | - :max_sitemap_news, # max news sitemap per index_file |
| 6 | - :max_sitemap_images, # max images per url |
| 7 | - :max_sitemap_filesize, # bytes |
| 8 | - :host, |
| 9 | - :filename, |
| 10 | - :public_path, |
| 11 | - :sitemaps_path, |
| 3 | + :max_sitemap_files, # Max sitemap links per index file |
| 4 | + :max_sitemap_links, # Max links per sitemap |
| 5 | + :max_sitemap_news, # Max news sitemap per index_file |
| 6 | + :max_sitemap_images, # Max images per url |
| 7 | + :max_sitemap_filesize, # Bytes |
| 8 | + :host, # Your domain, also host with http scheme. |
| 9 | + :filename, # Name of sitemap file. |
| 10 | + :public_path, # After domain path's location on URL. |
| 11 | + :files_path, # Generating sitemps to this directory path. |
| 12 12 | :adapter, |
| 13 13 | :verbose, |
| 14 14 | :compress, |
| @@ -25,13 +25,13 @@ defmodule Sitemap.Config do | |
| 25 25 | max_sitemap_news: ow[:max_sitemap_news] || System.get_env("SITEMAP_MAXNEWS") || Application.get_env(:sitemap, :max_sitemap_news, 1_000), |
| 26 26 | max_sitemap_images: ow[:max_sitemap_images] || System.get_env("SITEMAP_MAXIMAGES") || Application.get_env(:sitemap, :max_sitemap_images, 1_000), |
| 27 27 | max_sitemap_filesize: ow[:max_sitemap_filesize] || System.get_env("SITEMAP_MAXFILESIZE") || Application.get_env(:sitemap, :max_sitemap_filesize, 5_000_000), |
| 28 | - host: ow[:host] || System.get_env("SITEMAP_HOST") || Application.get_env(:sitemap, :host, "http://www.example.com"), |
| 28 | + host: ow[:host] || System.get_env("SITEMAP_HOST") || Application.get_env(:sitemap, :host, "http://www.example.com"), |
| 29 29 | filename: ow[:filename] || System.get_env("SITEMAP_FILENAME") || Application.get_env(:sitemap, :filename, "sitemap"), |
| 30 | - public_path: ow[:public_path] || System.get_env("SITEMAP_PUBLIC_PATH") || Application.get_env(:sitemap, :public_path, ""), |
| 31 | - sitemaps_path: ow[:sitemaps_path] || System.get_env("SITEMAP_SITEMAPS_PATH") || Application.get_env(:sitemap, :sitemaps_path, "sitemaps/"), |
| 32 | - adapter: ow[:adapter] || System.get_env("SITEMAP_ADAPTER") || Application.get_env(:sitemap, :adapter, Sitemap.Adapters.File), |
| 30 | + files_path: ow[:files_path] || System.get_env("SITEMAP_SITEMAPS_PATH") || Application.get_env(:sitemap, :files_path, "sitemaps/"), |
| 31 | + public_path: ow[:public_path] || System.get_env("SITEMAP_PUBLIC_PATH") || Application.get_env(:sitemap, :public_path, "sitemaps/"), |
| 32 | + adapter: ow[:adapter] || System.get_env("SITEMAP_ADAPTER") || Application.get_env(:sitemap, :adapter, Sitemap.Adapters.File), |
| 33 33 | verbose: ow[:verbose] || System.get_env("SITEMAP_VERBOSE") || Application.get_env(:sitemap, :verbose, true), |
| 34 | - compress: ow[:compress] || System.get_env("SITEMAP_COMPRESS") || Application.get_env(:sitemap, :comparess, true), |
| 34 | + compress: ow[:compress] || System.get_env("SITEMAP_COMPRESS") || Application.get_env(:sitemap, :compress, true), |
| 35 35 | create_index: ow[:create_index] || System.get_env("SITEMAP_CREATE_INDEX") || Application.get_env(:sitemap, :create_index, :auto), |
| 36 36 | }) |
| 37 37 | end |
| @@ -4,16 +4,12 @@ defmodule Sitemap.Location do | |
| 4 4 | |
| 5 5 | def directory(_name), do: directory |
| 6 6 | def directory do |
| 7 | - s = Config.get |
| 8 | - s.public_path |
| 9 | - |> Path.join(s.sitemaps_path) |
| 7 | + Config.get.files_path |
| 10 8 | |> Path.expand |
| 11 9 | end |
| 12 10 | |
| 13 11 | def path(name) do |
| 14 | - s = Config.get |
| 15 | - s.public_path |
| 16 | - |> Path.join(s.sitemaps_path) |
| 12 | + Config.get.files_path |
| 17 13 | |> Path.join(filename(name)) |
| 18 14 | |> Path.expand |
| 19 15 | end |
| @@ -21,7 +17,7 @@ defmodule Sitemap.Location do | |
| 21 17 | def url(name) do |
| 22 18 | s = Config.get |
| 23 19 | s.host |
| 24 | - |> Path.join(s.sitemaps_path) |
| 20 | + |> Path.join(s.public_path) |
| 25 21 | |> Path.join(filename(name)) |
| 26 22 | end |
| @@ -9,7 +9,7 @@ defmodule Sitemap.Mixfile do | |
| 9 9 | [ |
| 10 10 | app: :sitemap, |
| 11 11 | name: "Sitemap", |
| 12 | - version: "0.1.0", |
| 12 | + version: "0.1.1", |
| 13 13 | elixir: ">= 1.0.0", |
| 14 14 | description: @description, |
| 15 15 | build_embedded: Mix.env == :prod, |