sf-static/portfolio/views/index.pug

33 lines
1.2 KiB
Text
Raw Permalink Normal View History

2023-02-28 18:21:07 +00:00
extends layout
block content
//h1= title
img(src='/images/portfolio.svg',class='title')
img(src='/images/house.svg',class='hidden')
p(class='breadcrumbs')
span
a(href= '/' class='home')
each crumb in breadcrumbs
span
a(href= '/'+crumb.path) #{crumb.name}
ul
each item in items
li(class='item')
- var relativePathAndFile = item.path.replace('C:\\Users\\spenc\\OneDrive\\Code\\portfolio\\public\\work\\Portfolio\\','')
- var pathArray = relativePathAndFile.split('\\')
- var fileFullName = pathArray.pop()
- var relativePath = pathArray.join('/')
- var fileName = fileFullName.split('.', 1)
- var isImage = fileFullName.includes('.')
if isImage
a(href='/work/Portfolio/'+relativePathAndFile data-fancybox='gallery' data-options='{"caption" : "'+fileName+'", "thumbs": { "autoStart": true }, "buttons": ["zoom","fullScreen","close"], protect: true}', class='image')
figure(class='theme2')
figcaption= fileName
img(src='/work/Portfolio/'+relativePath+'/210x210/'+fileFullName)
else
a(href= '/'+relativePathAndFile, class='directory')
h3= fileFullName
else
li There are no values