all repos — aaoth.xyz @ 97c19c29cd3b9d7d69e103b6b78cd299a6428086

aaoth.xyz website

add categories to art page

whooah!

there is some tough liquid-tagging involved.
la-ninpre leobrekalini@gmail.com
Tue, 23 Feb 2021 14:23:15 +0300
commit

97c19c29cd3b9d7d69e103b6b78cd299a6428086

parent

25843593a10da466a1e769b8fdf17284e24d37e6

M _config.yml_config.yml

@@ -27,6 +27,6 @@ values:

image: true - scope: - path: "assets/img/art" + path: "art" values: art: true
A _includes/art-menu.html

@@ -0,0 +1,22 @@

+<div class="art-menu"> +{%- for page in site.pages -%} + {%- assign pagedir = page.dir | remove_first: "/" | split: "/" -%} + {%- capture arts -%} + {%- for file in site.static_files -%} + {%- if file.art and file.path contains page.title -%} + {{ file.path }} + {%- endif -%} + {%- endfor -%} + {%- endcapture -%} + {% assign artpics = arts | strip_newlines | split: " " %} + {%- if pagedir.first == "art" and pagedir.size > 1 -%} + <div class="art-category"> + <a href="{{ page.url }}"> + {{ page.title }} + <br> + <img src="{{ artpics.first }}"> + </a> + </div> + {% endif %} +{%- endfor -%} +</div>
A _includes/pic-path.html

@@ -0,0 +1,8 @@

+{%- capture arts -%} +{%- for file in site.static_files -%} + {%- if file.art and file.path contains page.title -%} + {{ file.path }} + {% endif %} +{%- endfor -%} +{%- endcapture -%} +{% assign artpics = arts | split: " " %}
A _layouts/art-category.html

@@ -0,0 +1,18 @@

+--- +layout: default +--- + +<h1>{{ page.title }}</h1> + +{{ content }} + +{%- include pic-path.html -%} <!-- provides artpics array --> + +<div class="art"> +{%- for imgpath in artpics -%} + {% assign imgname = imgpath | split: "/" | last | split: "." | first %} + <div class="art-img"> + <img src="{{ imgpath }}" alt="{{ imgname }}"> + </div> +{% endfor %} +</div>
M _sass/main.scss_sass/main.scss

@@ -160,6 +160,19 @@ padding-left: 10px;

} } +.art-menu { + display: flex; + flex-flow: row wrap; + align-items: flex-start; + justify-content: space-around; + .art-category { + img { + width: 100%; + height: auto; + } + } +} + .art { display: flex; flex-flow: row wrap;
M art.mdart.md

@@ -3,16 +3,8 @@ title: art

permalink: /art/ --- -{% assign image_files = site.static_files | where: "art", true %} - here are some photos and pictures. feel free to use them if and as you wish (don't forget to attribute). -<div class="art"> -{% for img in image_files %} - <div class="art-img"> - <img src="{{ img.path }}" alt="{{ img.name }}"> - </div> -{% endfor %} -</div> +{% include art-menu.html %}
A art/photos.md

@@ -0,0 +1,9 @@

+--- +title: photos +permalink: /art/photos/ +layout: art-category +--- + +photos taken in different times and various circumstances. + +i'm not a professional photographer, but i have something to show.
A art/renders.md

@@ -0,0 +1,8 @@

+--- +title: renders +permalink: /art/renders/ +layout: art-category +--- + +computer graphics is small part of my life too. +i'm working primarily in [blender](https://blender.org).