Skip to content

Commit

Permalink
fun gallery section, some general tweaks while at it
Browse files Browse the repository at this point in the history
  • Loading branch information
dhonus committed Jan 5, 2024
1 parent d05b799 commit f7fca91
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 12 deletions.
Empty file added Pasted image 16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 45 additions & 6 deletions assets/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ a
flex-direction: row
display: flex
text-align: left
line-height: 7rem
height: 7rem
width: 100%
gap: .5rem
vertical-align: middle
span.identity-text
display: flex
flex-direction: column
justify-content: center
gap: .3rem
h3
font-size: 1.4rem
line-height: 1.4rem
margin: 1rem 0 0 0
padding: 0
align-self: center
align-self: left
.logo
height: 7rem
width: 7rem
Expand Down Expand Up @@ -243,6 +247,7 @@ aside.meta-tags
padding: .3rem
background: #d8d8d0
cursor: pointer
color: black
div
background: #c5c4bb
height: 100%
Expand All @@ -252,6 +257,8 @@ aside.meta-tags
&:hover *
color: white
background: #819e75!important
&:hover button.tag-button
color: white

.tags p
margin: 0
Expand Down Expand Up @@ -417,6 +424,21 @@ article.split-me
h2
margin-bottom: .6rem

$gallery-gap: 1rem
.masonry-gallery
column-count: 3
column-gap: 2em
.masonry-item
display: inline-block
width: 100%
margin: 0 0 $gallery-gap 0
padding: 10px
border: 1px solid #bcbcbc
border-radius: 5px
img
width: 100%
height: auto

@media screen and (max-width: 1700px)
body
main
Expand Down Expand Up @@ -455,8 +477,23 @@ article.split-me
margin: 0
width: 90%
height: auto
.masonry-gallery
column-count: 2
column-gap: 2em

@media screen and (max-width: 1000px)
body main
width: 96%
nav#nav
padding: .4rem
.category_container div.category
display: grid
flex-direction: row
flex-wrap: wrap
grid-gap: 0.3rem
grid-template-columns: 1fr 1fr

@media screen and (max-width: 700px)
body
margin: 0
main
Expand All @@ -465,15 +502,12 @@ article.split-me
a
height: initial
line-height: 1.4rem
align-items: end
h3
font-size: 1.2rem
line-height: 1.4rem
.nav
margin: 1rem 0
flex-wrap: wrap
nav#nav
padding: .4rem
.category_container
padding: .8rem
h1
Expand All @@ -482,7 +516,8 @@ article.split-me
flex-direction: column
display: flex
span.article
max-width: 100%
width: 93%
margin: auto
div.cover_image
height: 300px
article.split-me
Expand Down Expand Up @@ -514,6 +549,10 @@ article.split-me
width: 75%
div.recent-posts div.article h2
font-size: revert
.masonry-gallery
column-count: 1
column-gap: 2em
width: 96%

@media screen and ( max-width: 750px )
article.content
Expand Down
2 changes: 1 addition & 1 deletion content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ draft: false

### What's this all about?
Well food of course! This is a personal project to write down and share my recipes. I love to cook and bake, and I would like to share my recipes with others.
The recipes are **all vegan** ([learn more](https://adaptt.org/)). I mostly aim to keep the description to the point and short. Also, I tend to mention some basic rules of the dish and which ingredients are optional.
The recipes are **all vegan**, here is one of my [favorite books](https://grupojovenfl.files.wordpress.com/2019/10/peter-singer-animal-liberation-1.pdf) on the subject. I try to keep the talk short and to the point. Some other interesting food photos can be found in the [snippets](/snippets) section.

All photos are mine and are subject to copyright under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/). All recipes are in the public domain.

Expand Down
Binary file added content/snippets/food/A melon I grew (smol).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Curry with puri.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Dumplings with tofu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Grandma's finest.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/I eat too much of this.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Nicecream.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Root vegetable soup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Sauerkraut soup.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Stuffed pepper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/These look f i n e.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Vegan "svíčková".jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Vegan goulash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Very vegan pizza.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/snippets/food/Watermelon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions content/snippets/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Vegan snippets"
date: 2023-01-19T23:11:13Z
draft: false
---
#
In the interest of bloating up my git repository I decided to add a gallery section of some of my favorite food photos. Enjoy!

{{< gallery dir="snippets/food" >}}
2 changes: 1 addition & 1 deletion themes/bean/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>Recent recipes</h2>
{{ range ( where .Site.RegularPages "Type" "posts" | first 5 ) }}
<div class="article" onclick="location.href='{{ .RelPermalink }}';">
{{ $diff := now.Sub .Lastmod }}
{{ if lt $diff.Hours 72 }}
{{ if lt $diff.Hours 120 }}
<div class="new">NEW</div>
{{ end }}
<div class="vertical"><a href="{{ .RelPermalink }}">
Expand Down
2 changes: 1 addition & 1 deletion themes/bean/layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1>{{ $title }}</h1>
{{ range .Paginator.Pages.ByDate.Reverse }}
<span class="article" onclick="location.href='{{ .RelPermalink }}';">
{{ $diff := now.Sub .Lastmod }}
{{ if lt $diff.Hours 72 }}
{{ if lt $diff.Hours 120 }}
<div class="new">NEW</div>
{{ end }}
<span><a href="{{ .RelPermalink }}">
Expand Down
2 changes: 1 addition & 1 deletion themes/bean/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2>{{ .Title }}</h2>
{{ range (.Paginate (.Pages).ByDate.Reverse).Pages | first 6 }}
<span class="article" onclick="location.href='{{ .RelPermalink }}';">
{{ $diff := now.Sub .Lastmod }}
{{ if lt $diff.Hours 72 }}
{{ if lt $diff.Hours 120 }}
<div class="new">NEW</div>
{{ end }}
<span><a href="{{ .RelPermalink }}">
Expand Down
12 changes: 10 additions & 2 deletions themes/bean/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
{{ $image := resources.Get "static/logo.png" }}
<img src="{{.Site.BaseURL}}{{ .Site.Params.logo }}" class="logo"/>
{{ if eq .Title .Site.Title }}
<h3>{{.Title}}</h3></a>
<span class="identity-text">
<h3>{{.Title}}</h3>
<span>{{ .Site.Params.description }}</span>
</span>
</a>
{{ else }}
{{ $first := substr .Title 0 1 }}
{{ $rest := substr .Title 1 }}
{{ $first = upper $first }}
{{ $title := print $first $rest }}
<h3>{{ $title }} | {{ .Site.Title }}</h3></a>
<span class="identity-text">
<h3>{{ $title }} | {{ .Site.Title }}</h3>
<span>{{ .Site.Params.description }}</span>
</span>
</a>
{{ end }}
</span>
<span class="nav">
Expand Down
18 changes: 18 additions & 0 deletions themes/bean/layouts/shortcodes/gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ $dir := .Get "dir" }}
{{ $images := .Page.Resources.ByType "image" }}

<div class="masonry-gallery">
{{ range $images }}
{{ $ext := path.Ext .Name | strings.TrimPrefix "." }}
{{ if in (slice "jpg" "jpeg" "png" "webp") $ext }}
{{ $image := . }}
{{ $image = $image.Process "resize 700x" }}
{{ if $image }}
<figure class="masonry-item">
<img src="{{ $image.RelPermalink }}" alt="{{ .Name }}">
<figcaption>{{ path.Base .Name | strings.TrimSuffix (printf ".%s" $ext) | strings.Title }}</figcaption>
</figure>
{{ end }}
{{ end }}
{{ end }}
</div>

0 comments on commit f7fca91

Please sign in to comment.