Skip to content

Commit

Permalink
new recipe badge
Browse files Browse the repository at this point in the history
  • Loading branch information
dhonus committed Jan 1, 2024
1 parent b9a5fd0 commit e8c6a8d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
11 changes: 11 additions & 0 deletions assets/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ nav.pagination
grid-gap: .3rem
grid-template-columns: 1fr 1fr 1fr
span.article
position: relative
text-align: center
padding: 10px
border: 1px solid #bcbcbc
Expand Down Expand Up @@ -134,6 +135,16 @@ nav.pagination
margin-bottom: 10px
&:hover
background: #e6dfcd
div.new
position: absolute
top: 1rem
right: 1rem
background: #819e75
color: white
padding: .2rem .5rem
border-radius: 5px
font-size: .8rem
box-shadow: 0 0 5px #00000061

div.recent-posts
border-top: 1px solid silver
Expand Down
2 changes: 1 addition & 1 deletion content/posts/savory/farfalle-soup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Farfalle soup with cashew ricotta"
date: 2023-12-28T11:00:00+01:00
draft: false
tags: ["lunch", "italian", "pasta", "soup", "tomates"]
tags: ["lunch", "italian", "pasta", "soup"]
categories: ["Savory"]
---

Expand Down
6 changes: 5 additions & 1 deletion themes/bean/layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ <h1>{{ .Title }}</h1>
<div class="category">
{{ range .Paginator.Pages.ByDate.Reverse }}
<span class="article" onclick="location.href='{{ .RelPermalink }}';">
{{ $diff := now.Sub .Lastmod }}
{{ if lt $diff.Hours 72 }}
<div class="new">NEW</div>
{{ end }}
<span><a href="{{ .RelPermalink }}">
{{ with .Resources }}
{{ with .GetMatch "{cover.*,*.jpg,*.webp,*.png,*.jpeg}" }}
Expand All @@ -48,7 +52,7 @@ <h1>{{ .Title }}</h1>
</a>
<a href="{{ .RelPermalink }}"><h2>{{ .Title }}</h2></a>
{{ .Summary | truncate 200 }}
</span>
</span>
<span>
{{ if .Truncated }}
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
Expand Down
4 changes: 4 additions & 0 deletions themes/bean/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ <h2>{{ .Title }}</h2>
<div class="category">
{{ range (.Paginate (.Pages).ByDate.Reverse).Pages | first 6 }}
<span class="article" onclick="location.href='{{ .RelPermalink }}';">
{{ $diff := now.Sub .Lastmod }}
{{ if lt $diff.Hours 72 }}
<div class="new">NEW</div>
{{ end }}
<span><a href="{{ .RelPermalink }}">
{{ with .Resources }}
{{ with .GetMatch "{cover.*,*.jpg,*.webp,*.png,*.jpeg}" }}
Expand Down

0 comments on commit e8c6a8d

Please sign in to comment.