summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authormms <michal@sapka.me>2023-12-22 22:22:14 +0100
committermms <michal@sapka.me>2023-12-22 22:22:14 +0100
commit577bb0c8efadfb7c60e0fed8e46f986bd6edcb7a (patch)
tree964e8c9025a8d8382558ff07e6ef135a201f5cc3 /layouts
parenta834ab11ba14daf6f1d7c95705c26cb7c4e30507 (diff)
feat: org for st, fin
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/img-r.html17
-rw-r--r--layouts/shortcodes/menu.html13
-rw-r--r--layouts/shortcodes/recent-updates.html14
3 files changed, 40 insertions, 4 deletions
diff --git a/layouts/shortcodes/img-r.html b/layouts/shortcodes/img-r.html
new file mode 100644
index 0000000..4340792
--- /dev/null
+++ b/layouts/shortcodes/img-r.html
@@ -0,0 +1,17 @@
+{{- $file := .Get 0 }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
+{{- $caption := .Inner}}
+ <img
+ class="float-right"
+ alt="{{ $caption }}"
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.RelPermalink }} 1x,
+ {{ $img2x.RelPermalink }} 2x
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
+>
diff --git a/layouts/shortcodes/menu.html b/layouts/shortcodes/menu.html
new file mode 100644
index 0000000..1b3dc54
--- /dev/null
+++ b/layouts/shortcodes/menu.html
@@ -0,0 +1,13 @@
+{{- $menuID := .Get 0 }}
+{{- $caption := .Inner }}
+
+<nav>
+ <ol>
+ {{- range index site.Menus $menuID }}
+ <li>
+ <a href="{{ .URL }}">
+ {{ .Name }}
+ </a>
+ {{- end }}
+</ol>
+</nav>
diff --git a/layouts/shortcodes/recent-updates.html b/layouts/shortcodes/recent-updates.html
index 24d3c95..959ebf5 100644
--- a/layouts/shortcodes/recent-updates.html
+++ b/layouts/shortcodes/recent-updates.html
@@ -1,10 +1,16 @@
{{ $category := .Get 0 }}
{{ $filter := slice $category }}
{{ $more_link := .Get 1 }}
-{{ .Inner }}
+{{ $caption := .Inner }}
<nav>
-{{ range (where .Site.RegularPages ".Params.category" "intersect" $filter) }}
- {{ partial "partials/article_list_item.html" . }}
-{{ end }}
+ {{- range
+ (where .Site.RegularPages ".Params.category" "intersect" $filter).ByDate.Reverse }}
+ {{ partial "partials/article_list_item.html" . }}
+ {{- end }}
+
+ {{- range
+ (where .Site.RegularPages ".Params.Categories" "intersect" $filter).ByDate.Reverse }}
+ {{ partial "partials/article_list_item.html" . }}
+ {{- end }}
</nav>