add lightbox to multi image
This commit is contained in:
		
							
								
								
									
										28
									
								
								.eleventy.js
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								.eleventy.js
									
									
									
									
									
								
							@ -40,21 +40,22 @@ module.exports = function (eleventyConfig) {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var slug = title
 | 
					    var slug = title
 | 
				
			||||||
    .toLowerCase()
 | 
					      .toLowerCase()
 | 
				
			||||||
    .trim()
 | 
					      .trim()
 | 
				
			||||||
    // remove accents
 | 
					      // remove accents
 | 
				
			||||||
    .normalize('NFD')
 | 
					      .normalize('NFD')
 | 
				
			||||||
    .replace(/[\u0300-\u036f]/g, '')
 | 
					      .replace(/[\u0300-\u036f]/g, '')
 | 
				
			||||||
    // replace invalid characters with spaces
 | 
					      // replace invalid characters with spaces
 | 
				
			||||||
    .replace(/[^a-z0-9\s-]/g, ' ')
 | 
					      .replace(/[^a-z0-9\s-]/g, ' ')
 | 
				
			||||||
    .trim()
 | 
					      .trim()
 | 
				
			||||||
    // replace multiple spaces or hyphens with a hyphen
 | 
					      // replace multiple spaces or hyphens with a hyphen
 | 
				
			||||||
    .replace(/[\s-]+/g, '-');
 | 
					      .replace(/[\s-]+/g, '-');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return `<hr>
 | 
					    return `<hr>
 | 
				
			||||||
    <p>
 | 
					    <p>
 | 
				
			||||||
      <strong>${title}</strong><br>
 | 
					      <strong>${title}</strong><br>
 | 
				
			||||||
      ${// evil nested tertiary this is the worlds least oneline oneliner
 | 
					      ${
 | 
				
			||||||
 | 
					      // evil nested tertiary this is the worlds least oneline oneliner
 | 
				
			||||||
      !link || link == "" ?
 | 
					      !link || link == "" ?
 | 
				
			||||||
        "" :
 | 
					        "" :
 | 
				
			||||||
        Array.isArray(link) ?
 | 
					        Array.isArray(link) ?
 | 
				
			||||||
@ -65,8 +66,9 @@ module.exports = function (eleventyConfig) {
 | 
				
			|||||||
      }${!image || image == "" ?
 | 
					      }${!image || image == "" ?
 | 
				
			||||||
        "" :
 | 
					        "" :
 | 
				
			||||||
        Array.isArray(image) ?
 | 
					        Array.isArray(image) ?
 | 
				
			||||||
          image.map((i) => `<img src="${i}"/><br>`).join(" ") :
 | 
					          image.map((i, index) => `<a href="#img_${slug}_${index}"><img src="${image}"/></a><br>
 | 
				
			||||||
          `<a href="#img_${slug}"><img src="${image}"/><br></a>
 | 
					          <a href="#_${slug}_${index}" class="lightbox trans" id="img_${slug}_${index}"><img src="${image}"/></a>`).join(" ") :
 | 
				
			||||||
 | 
					          `<a href="#img_${slug}"><img src="${image}"/></a><br>
 | 
				
			||||||
          <a href="#_${slug}" class="lightbox trans" id="img_${slug}"><img src="${image}"/></a>`
 | 
					          <a href="#_${slug}" class="lightbox trans" id="img_${slug}"><img src="${image}"/></a>`
 | 
				
			||||||
      }${!video || video == "" ?
 | 
					      }${!video || video == "" ?
 | 
				
			||||||
        "" :
 | 
					        "" :
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user