15. A computer program product comprising a non-transitory computer-readable storage medium having instructions encoded thereon that, when executed by a processor, cause the processor to: receive a plurality of content items; determine size constraints of each of the plurality of content items; select a plurality of candidate templates each having a number of slots, each slot defining a portion of a page within which a content item is displayed; for each candidate template of the plurality of candidate templates, determine a score for the candidate template by: determining a score for each slot of the candidate template based on a difference between a size of the slot of the candidate template and the size constraints of one or more of the plurality of content items, where a minimum score is assigned to the slot if the size difference between the size of the slot and size constraints of the content item exceeds a threshold difference, and determining the score for the candidate template based on aggregating the scores of the slots of the candidate template; select a template from the plurality of candidate templates based on the determined scores; and generate the page for presentation to a user, the page including one or more of the plurality of content items positioned based on slots in the selected template.
16. The computer program product of claim 15 , wherein each of the plurality of content items have an asset type selected from a group consisting of text and image.