diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2021-05-27 00:13:05 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2021-05-27 00:19:10 +0300 |
| commit | 324991d82ef26798ed5842a6fe03eabc798ff497 (patch) | |
| tree | 8097dad5a93e283e42e7b4a1e0491d389b912c76 /_layouts | |
| parent | 3e30c7241cb18c5e02195e889b9e4dc73490214a (diff) | |
| download | aaoth.xyz-324991d82ef26798ed5842a6fe03eabc798ff497.tar.gz aaoth.xyz-324991d82ef26798ed5842a6fe03eabc798ff497.zip | |
modify art page to display thumbnails
thumbnails are currently created using shell script and require
imagemagick installed on the server. i know it's stupid, but i think
that including thumbnails to repo is also stupid.
maybe later i replace this script with actual jekyll plugin, but for
this i'll need to familiarize myself with ruby.
but now i use following addition to the git hook on the server:
```
[ -f "$TMP_GIT_CLONE/art/thumbs.sh" ] && {
dir="$PWD"
cd "$TMP_GIT_CLONE/art/" && sh thumbs.sh && cd "$dir"
}
```
it happens after cloning to remote repo and before building with bundle.
overall, this is a bodge now, it recompiles all thumbnails every time
due to quirks in my current setup.
Diffstat (limited to '_layouts')
| -rw-r--r-- | _layouts/about-page.html | 3 | ||||
| -rw-r--r-- | _layouts/art-category.html | 16 |
2 files changed, 14 insertions, 5 deletions
diff --git a/_layouts/about-page.html b/_layouts/about-page.html index 6603cde..d734d94 100644 --- a/_layouts/about-page.html +++ b/_layouts/about-page.html @@ -4,7 +4,8 @@ layout: default <div class="about"> <div class="about-sidebar"> - <img id="avatar" alt="aaoth-photo" src="/assets/img/aaoth-photo.jpeg"> + <img id="avatar" alt="aaoth-photo" + width=128px height=128px src="/assets/img/aaoth-photo.jpeg"> <div class="about-links"> <p>other links:</p> <ul> diff --git a/_layouts/art-category.html b/_layouts/art-category.html index fb70a11..dc8ce12 100644 --- a/_layouts/art-category.html +++ b/_layouts/art-category.html @@ -6,13 +6,21 @@ layout: default {{ content }} -{%- include pic-path.html -%} <!-- provides artpics array --> +{%- include pic-path.html -%} +{% comment %} + upper include provides `artpics` array + and `artthumbs` array, which are used later +{% endcomment %} <div class="art"> -{%- for imgpath in artpics -%} - {% assign imgname = imgpath | split: "/" | last | split: "." | first %} +{%- assign pics_n = artpics.size -%} +{%- assign range = (0..pics_n) -%} +{%- for i in range -%} + {%- assign imgname = artpics[i] | split: "/" | last | split: "." | first -%} <div class="art-img"> - <img src="{{ imgpath }}" alt="{{ imgname }}"> + <a href="{{ artpics[i] }}" target="_blank"> + <img src="{{ artthumbs[i] }}" alt="{{ imgname }}"> + </a> </div> {% endfor %} </div> |
