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
19 files changed,
80 insertions(+),
10 deletions(-)
jump to
M
_config.yml
→
_config.yml
@@ -27,6 +27,6 @@ values:
image: true - scope: - path: "assets/img/art" + path: "art" values: art: true
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.md
→
art.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).