Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created October 23, 2016 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcardarella/14f61ef0774a18f1183d5617ac81167e to your computer and use it in GitHub Desktop.
Save bcardarella/14f61ef0774a18f1183d5617ac81167e to your computer and use it in GitHub Desktop.
defmodule DockYard.Sitemaps.Blog do
use Sitemap, host: "https://#{Application.get_env(:dockyard, DockYard.Endpoint)[:url][:host]}"
def generate do
posts = DockYard.Repo.all(DockYard.Post)
create do
Enum.each(posts, fn(post) ->
add "blog/#{post.slug}", priority: 0.5, changefreq: "hourly", expires: nil, mobile: true
end)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment