Created
October 23, 2016 10:46
-
-
Save bcardarella/14f61ef0774a18f1183d5617ac81167e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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