edryd.org

some of my neat stuff
git clone git://edryd.org/edryd.org
Log | Files | Refs | LICENSE

photos.html (1274B)


      1 <div class="container">
      2   <div class="row">
      3     <div class="col-12">
      4       {{ if lt (.Get "limit") 10 }}
      5         <h2 class="heading pt-5">{{ .Get "dir" | upper }}</h2>
      6       {{ end }}
      7       <div class="row photos">
      8         {{ $dir := (path.Join "/photos/" (replace (.Get "dir") " " "-")) }}
      9         {{ range first (.Get "limit") (readDir (path.Join "/static/img" $dir)) }}
     10           {{ $imgURL := path.Join "/img" $dir .Name | relURL }}
     11           {{ $thmURL := path.Join "/img" $dir "thumb." .Name | relURL }}
     12           <a href="{{ $imgURL }}" data-lightbox="image-1">
     13             <!-- TODO generate thumbnail -->
     14             <img src="{{ $imgURL }}" alt="image">
     15           </a>
     16         {{ end }}
     17       </div>
     18       {{ if not (eq (.Get "dir") "best")}}
     19         <div class="row justify-content-center">
     20           <div class="col-md-3 btn-effect">
     21             {{ if lt (.Get "limit") 10 }}
     22               <a class="btn btn-block" href="{{ $dir }}">
     23                 See More <i class="fa fa-images ml-2"></i>
     24               </a>
     25             {{ else }}
     26               <a class="btn btn-block" href="..">
     27                 All Photos <i class="fa fa-images ml-2"></i>
     28               </a>
     29             {{ end }}
     30           </div>
     31         </div>
     32       {{ end }}
     33     </div>
     34   </div>
     35 </div>