From 33ec8cacbeb3f1d2febbd6a7ed3e1d30275df7ac Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 20 Apr 2022 20:09:08 -0400 Subject: [PATCH] Add mixins --- includes/head.pug | 20 -------------------- includes/mixins.pug | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/includes/head.pug b/includes/head.pug index 3743836..6aac6b3 100644 --- a/includes/head.pug +++ b/includes/head.pug @@ -52,23 +52,3 @@ body li: a(href="outreach.html") Outreach li: a(href="community-involvement.html") Community Involvement li: a(href="contact.html") Contact - -mixin bigimage(src, alt, ryanhawk) - figure - // =img_big(src=src, alt=alt) - - var loc = src.replace(/[.].+?$/, ""); - - var ext = src.replace(/^.+[.]/, ""); - a(href=`images/${loc}-full.${ext}`) - picture.big - source(type="image/webp" srcset=`images/${loc}-full.webp`) - source(srcset=`images/${loc}-full.${ext}`) - img(src=`images/${loc}-full.${ext}`) - - - // img(srcset=`images/${loc}-full.webp images/${loc}-full.${ext}` src=`images/${loc}-full.${ext}`, alt=alt) - - // img(src=`images/${loc}-full.webp`) - figcaption - block - if ryanhawk - +ryanhawk diff --git a/includes/mixins.pug b/includes/mixins.pug index d6e6fc1..93d3aca 100644 --- a/includes/mixins.pug +++ b/includes/mixins.pug @@ -16,3 +16,36 @@ mixin ryanhawk // else // a(href="#{src}.") // img.big(src=src, alt=alt) + +mixin bigimage(src, alt, ryanhawk) + figure + // =img_big(src=src, alt=alt) + - var loc = src.replace(/[.].+?$/, ""); + - var ext = src.replace(/^.+[.]/, ""); + a(href=`images/${loc}-full.${ext}`) + picture.big + source(type="image/webp" srcset=`images/${loc}-full.webp`) + source(srcset=`images/${loc}-full.${ext}`) + img(src=`images/${loc}-full.${ext}`) + + + // img(srcset=`images/${loc}-full.webp images/${loc}-full.${ext}` src=`images/${loc}-full.${ext}`, alt=alt) + + // img(src=`images/${loc}-full.webp`) + figcaption + block + if ryanhawk + +ryanhawk + +mixin bigimage_slider(src, alt, ryanhawk) + figure + - var loc = src.replace(/[.].+?$/, ""); + - var ext = src.replace(/^.+[.]/, ""); + a(href=`images/${loc}-full.${ext}`) + picture.big + source(type="image/webp" srcset=`images/${loc}-full.webp`) + source(srcset=`images/${loc}-full.${ext}`) + img(src=`images/${loc}-full.${ext}`) + figcaption + if ryanhawk + +ryanhawk