-
-
Save audreyt/7723325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrap.clearfix | |
- fs=require('fs'); | |
- var glob=function(folder, regexp){ | |
- var result=[]; | |
- var files=fs.readdirSync(folder); for(var i=0;i<files.length;i++){ | |
- var target_file = folder+'/'+files[i]; | |
- var target_path = folder+'.html'; | |
- var target_topic = target_path.slice(target_path.indexOf('/'),target_path.lastIndexOf('/')); | |
- var target_author = folder.slice(folder.lastIndexOf('/')); | |
- var stat = fs.statSync(target_file); | |
- if(stat.isDirectory()){ result=result.concat(glob(target_file,regexp))} | |
- if(stat.isFile() && target_file.match(regexp)){ result.push([target_file,target_path,target_topic,target_author])} | |
- } | |
- return result; | |
- }; | |
.ui.horizontal.divider 插畫 | |
- files=(glob("../portfolio/illustration",/.(png|jpg)/)) | |
each f in files | |
.thumbnail | |
.ui.ribbon.label.blue PSD | |
a(href=f[1]) | |
img.rounded.ui.image(src=f[0]) | |
p.topic=f[2] | |
span.ui.bottom.right.attached.label.small.circular.black=f[3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment