Generate links, sort items.