Skip to content

Instantly share code, notes, and snippets.

@audreyt
Forked from ETBlue/gist:7723307
Last active October 23, 2021 14:10
Show Gist options
  • Save audreyt/7723325 to your computer and use it in GitHub Desktop.
Save audreyt/7723325 to your computer and use it in GitHub Desktop.
.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