9. A method for presenting content items comprising: receiving a plurality of content items; determining size constraints of each of the plurality of content items; selecting 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, determining a score for the candidate template by: determining a score for each slot of the candidate template based on a degree of resizing needed to fit one or more of the plurality of content items into the slot, where a minimum score is assigned to a slot if greater than a threshold degree of resizing is needed to fit a content item of the plurality of content items into the slot, and determining the score for the candidate template based on aggregating the scores of the slots of the candidate template; selecting a template from the plurality of candidate templates based on the determined scores; and generating 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.
9. A method for presenting content items comprising: receiving a plurality of content items; determining size constraints of each of the plurality of content items; selecting 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, determining a score for the candidate template by: determining a score for each slot of the candidate template based on a degree of resizing needed to fit one or more of the plurality of content items into the slot, where a minimum score is assigned to a slot if greater than a threshold degree of resizing is needed to fit a content item of the plurality of content items into the slot, and determining the score for the candidate template based on aggregating the scores of the slots of the candidate template; selecting a template from the plurality of candidate templates based on the determined scores; and generating 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. 10. The method of claim 9 , wherein one or more of the plurality of content items comprise user-generated posts on social networks.