Floorplan

Floorplan is a library for generating sitemaps. It takes a index name and a collection of data sources to produce your site’s sitemap.

It currently has built-in adapters for ecto or elasticsearch data sources. See Examples for usage.

Installation

If available in Hex, the package can be installed as:

  1. Add floorplan to your list of dependencies in mix.exs:

    def deps do
      [{:floorplan, "~> 0.0.1"}]
    end
  2. Ensure floorplan is started before your application:

    def application do
      [applications: [:floorplan]]
    end
  3. Define base_url within your applications config:

    ## within config.ex
    config :floorplan, base_url: "https://www.househappy.org"

    3b. Additional optional configuration:

    ## within config.ex
    config :floorplan, queue_size: 25_000
    config :floorplan, :elasticsearch, host: "http://localhost:9200"

Usage

defmodule MySitemapGenerator do
  def generate(index_name) do
    Floorplan.generate(index_name, data_sources)
  end

  def data_sources do
    [
      CoreLinks.all,
      ContentLinks.all
    ] |> Stream.concat
  end
end

iex> MySitemapGenerator.generate("tmp/sitemap.xml")

See Examples for more usage.

Contributions

Code is licensed under BSD License.

PRs/Issues welcome!