edryd.org

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

projects.html (3083B)


      1 {{ define "main" }}
      2   <style>
      3     .heading:after {
      4       margin-right: auto;
      5       margin-left: auto;
      6     }
      7   </style>
      8   <section>
      9     <div class="container">
     10       <div class="row">
     11         <div class="col-lg-12">
     12           {{- with .Title }}
     13             <h1 class="heading text-md-center">{{ . | upper }}</h1>
     14           {{- end }}
     15           <div class="row">
     16             <!-- TODO remove code duplication from _default/list -->
     17             <div class="container">
     18               <!-- TODO combine code and scripts, loop over all projects -->
     19               {{ range $.Site.Data.projects.code }}
     20                 <div class="row text-inc">
     21                   {{ $link := or .link (path.Join "projects/" .name | relURL) }}
     22                   <div class="col-lg-4 text-lg-right"><a href="{{ $link }}">{{ .name }}</a></div>
     23                   <div class="col-lg-8"><a href="{{ $link }}" class="italic-off text-primary">{{ .desc }}</a></div>
     24                 </div>
     25               {{ end }}
     26               <h2 class="heading pt-4 text-md-center">RESEARCH</h2>
     27               {{ range $.Site.Data.projects.research }}
     28                 <div class="row text-inc">
     29                   {{ $link := or .link (path.Join "projects/" .name | relURL) }}
     30                   <div class="col-lg-4 text-lg-right"><a href="{{ $link }}">{{ .name }}</a></div>
     31                   <div class="col-lg-8"><a href="{{ $link }}" class="italic-off text-primary">{{ .desc }}</a></div>
     32                 </div>
     33               {{ end }}
     34               <h2 class="heading pt-4 text-md-center">WEBSITES</h2>
     35               <!-- TODO cards with photos -->
     36               {{ range $.Site.Data.projects.websites }}
     37                 <div class="row text-inc">
     38                   <div class="col-lg-4 text-lg-right"><a href="{{ .link }}">{{ .name }}</a></div>
     39                   <div class="col-lg-8"><a href="{{ .link }}" class="italic-off text-primary">{{ .desc }}</a></div>
     40                 </div>
     41               {{ end }}
     42               <h2 class="heading pt-4 text-md-center">SCRIPTS</h2>
     43               {{ range $.Site.Data.projects.scripts }}
     44                 {{ $link := path.Join "projects/" .name | relURL }}
     45                 {{ $name := .name }}
     46                 {{ $url := printf "https://api.github.com/gists/%s" .id }}
     47                 {{ with try (resources.GetRemote $url) }}
     48                   {{ with .Err }}
     49                     {{ errorf "%s" . }}
     50                   {{ else with .Value }}
     51                     {{ $gist := . | transform.Unmarshal }}
     52                     <div class="row text-inc">
     53                       <div class="col-lg-4 text-lg-right"><a href="{{ $link }}">{{ $name }}</a></div>
     54                       <div class="col-lg-8"><a href="{{ $link }}" class="italic-off text-primary">{{ $gist.description }}</a></div>
     55                     </div>
     56                   {{ else }}
     57                     {{ errorf "Unable to get remote resource %q" $url }}
     58                   {{ end }}
     59                 {{ end }}
     60               {{ end }}
     61             </div>
     62           </div>
     63         </div>
     64       </div>
     65     </div>
     66   </section>
     67 {{ end }}