edryd.org

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

commit 0dff42718435fa68b3d3a39aa1a719001ea84a3d
parent aa9e641d4cb1d3edd37ca205a9e57591b0fc5c7f
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Fri,  2 Jul 2021 01:23:57 -0700

Include all best photos at top of photos page

Diffstat:
Mlayouts/shortcodes/photos.html | 26++++++++++++++------------
Mmk-content.py | 1+
2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/layouts/shortcodes/photos.html b/layouts/shortcodes/photos.html @@ -15,19 +15,21 @@ </a> {{ end }} </div> - <div class="row justify-content-center"> - <div class="col-md-3 btn-effect"> - {{ if lt (.Get "limit") 10 }} - <a class="btn btn-block" href="{{ $dir }}"> - See More <i class="fa fa-images ml-2"></i> - </a> - {{ else }} - <a class="btn btn-block" href=".."> - All Photos <i class="fa fa-images ml-2"></i> - </a> - {{ end }} + {{ if not (eq (.Get "dir") "best")}} + <div class="row justify-content-center"> + <div class="col-md-3 btn-effect"> + {{ if lt (.Get "limit") 10 }} + <a class="btn btn-block" href="{{ $dir }}"> + See More <i class="fa fa-images ml-2"></i> + </a> + {{ else }} + <a class="btn btn-block" href=".."> + All Photos <i class="fa fa-images ml-2"></i> + </a> + {{ end }} + </div> </div> - </div> + {{ end }} </div> </div> </div> diff --git a/mk-content.py b/mk-content.py @@ -60,6 +60,7 @@ with open('data/photos.yaml') as d: data = yaml.load(d, Loader=yaml.FullLoader) with open(f'content/photos/_index.md', 'w') as f: f.write(f'---\ntitle: photos\n---\n') + f.write(f'{{{{< photos limit="999" dir="best">}}}}\n') for album in data['photos']: f.write(f'{{{{< photos limit="5" dir="{album["name"]}">}}}}\n') for album in data['photos']: