diff --git a/lib/hexdocs/bucket.ex b/lib/hexdocs/bucket.ex index 73b82dd..9896d5d 100644 --- a/lib/hexdocs/bucket.ex +++ b/lib/hexdocs/bucket.ex @@ -81,7 +81,8 @@ defmodule Hexdocs.Bucket do for version <- versions do %{ version: "v#{version}", - url: Hexdocs.Utils.hexdocs_url(repository, "/#{package}/#{version}") + url: Hexdocs.Utils.hexdocs_url(repository, "/#{package}/#{version}"), + latest: Hexdocs.Utils.latest_version?(package, version, versions) } end diff --git a/test/hexdocs/queue_test.exs b/test/hexdocs/queue_test.exs index 9f5a0e1..283b415 100644 --- a/test/hexdocs/queue_test.exs +++ b/test/hexdocs/queue_test.exs @@ -255,11 +255,13 @@ defmodule Hexdocs.QueueTest do assert Jason.decode!(json) == [ %{ "url" => "http://localhost/#{URI.encode(Atom.to_string(test))}/3.0.0", - "version" => "v3.0.0" + "version" => "v3.0.0", + "latest" => true }, %{ "url" => "http://localhost/#{URI.encode(Atom.to_string(test))}/1.0.0", - "version" => "v1.0.0" + "version" => "v1.0.0", + "latest" => false } ] end