Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Created September 1, 2017 23:46
Show Gist options
  • Save claudiainbytes/08c600d933de833f859a5f454f750086 to your computer and use it in GitHub Desktop.
Save claudiainbytes/08c600d933de833f859a5f454f750086 to your computer and use it in GitHub Desktop.
var projects = {
"projects": [
{
"title": "Sandwich Qbano",
"dates": "2011",
"description": "Concurso Música en Altamar",
"images": ["11-img-large.jpg", "11-img-small.jpg"]
},
{
"title": "Sweet Lemon",
"dates": "2012",
"description": "Web Development",
"images": ["12-img-large.jpg", "12-img-small.jpg"]
},
{
"title": "Web de Cobbito",
"dates": "2011",
"description": "Web Development",
"images": ["13-img-large.jpg", "13-img-small.jpg"]
},
{
"title": "Universidad Manuela Beltrán",
"dates": "2014",
"description": "Web Development",
"images": ["14-img-large.jpg", "14-img-small.jpg"]
},
{
"title": "MINTIC Territorial Platforms",
"dates": "2016",
"description": "Web Maintenance",
"images": ["15-img-large.jpg", "15-img-small.jpg"]
}
]
};
projects.display = function() {
var locations = [];
this.projects.forEach(function(project){
$("#projects").append(HTMLprojectStart);
var formattedProjectTitle = HTMLprojectTitle.replace("%data%", project.title);
$(".project-entry:last").append(formattedProjectTitle);
var formattedProjectDates = HTMLprojectDates.replace("%data%", project.dates);
$(".project-entry:last").append(formattedProjectDates);
var formattedProjectDescription = HTMLprojectDescription.replace("%data%", project.description);
$(".project-entry:last").append(formattedProjectDescription);
if( project.images.length == 0 ){
var formattedProjectImage = "";
project.images.forEach(function(image){
formattedProjectImage = HTMLprojectImage.replace("%data%", "images/" + image);
$(".project-entry:last").append(formattedProjectImage);
});
}
});
};
projects.display();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment