summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/content_images/me-grim.pngbin0 -> 4533 bytes
-rw-r--r--config/_default/menus.en.toml2
-rw-r--r--layouts/partials/homepage/nav.html50
-rw-r--r--layouts/partials/menu/item.html7
-rw-r--r--resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_150x0_resize_q75_h2_box_3.webpbin0 -> 1742 bytes
-rw-r--r--resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_300x0_resize_q75_h2_box_3.webpbin0 -> 3298 bytes
6 files changed, 53 insertions, 6 deletions
diff --git a/assets/content_images/me-grim.png b/assets/content_images/me-grim.png
new file mode 100644
index 0000000..49d5a0d
--- /dev/null
+++ b/assets/content_images/me-grim.png
Binary files differ
diff --git a/config/_default/menus.en.toml b/config/_default/menus.en.toml
index 5f5d3c8..8f6b4ca 100644
--- a/config/_default/menus.en.toml
+++ b/config/_default/menus.en.toml
@@ -41,6 +41,8 @@
name = "Ko-fi"
url = "https://ko-fi.com/mmspl"
weight = 70
+ [[main-nav.params]]
+ forcedId = "ko-fi"
[[main-nav]]
name = "Uses"
diff --git a/layouts/partials/homepage/nav.html b/layouts/partials/homepage/nav.html
index 69e9e65..829323e 100644
--- a/layouts/partials/homepage/nav.html
+++ b/layouts/partials/homepage/nav.html
@@ -1,8 +1,3 @@
-{{- $file := "me.png" }}
-{{- $path := printf "content_images/%s" $file}}
-{{- $img := resources.Get $path }}
-{{- $img1x := $img.Resize "150x webp" }}
-{{- $img2x := $img.Resize "300x webp" }} <!-- -->
<section style="display: flow-root">
<h2>About</h2>
@@ -14,9 +9,35 @@
<a href="/bsd"/>BSD</a> and <a href="/emasc">Emacs</a> are quite self-explanatory.
I take special fondness of <a href="/star-trek">Star Trek</a> so it is a section of its own.
I also have a dedicated <a href="/blog">blog</a>, but this site is not a blog.
+
+{{- $file := "me.png" }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
+
<img
alt="Michal"
style="float: right; max-width: 20%;"
+ id="me-normal"
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
+ >
+
+{{- $file := "me-grim.png" }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
+ <img
+ alt="Grimacing michal"
+ style="float: right; max-width: 20%; display: none"
+ id="me-grim"
src="{{ $img1x.Permalink }}"
srcset="
{{ $img1x.Permalink }} 1x,
@@ -25,6 +46,25 @@
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
>
+
{{ partial "menu.html" (dict "menuID" "main-nav" "page" .) }}
+
+ <script>
+ var kofiLink = document.getElementById('ko-fi');
+ var meNormal = document.getElementById('me-normal');
+ var meGrim = document.getElementById('me-grim');
+
+ kofiLink.addEventListener( 'mouseover', function() {
+ meNormal.style.display="none"
+ meGrim.style.display="inline"
+ });
+
+ kofiLink.addEventListener( 'mouseout', function() {
+ meNormal.style.display="inline"
+ meGrim.style.display="none"
+ });
+
+ </script>
+
</section>
diff --git a/layouts/partials/menu/item.html b/layouts/partials/menu/item.html
index f50d604..adc8d55 100644
--- a/layouts/partials/menu/item.html
+++ b/layouts/partials/menu/item.html
@@ -18,7 +18,12 @@
{{- else if $item.Params.placeholder }}
<span class="placeholder">{{ $item.Pre }}{{$item.Name }}{{ $item.Post }}</span>
{{- else}}
- {{$item.Pre}} <b><a href="{{ $item.URL }}">{{ $item.Name }}</a></b>
+ {{$item.Pre}} <b>
+ <a
+ {{ if $item.Params.forcedId }}id="{{ $item.Params.forcedId }}"{{ end }}
+ href="{{ $item.URL }}">{{ $item.Name }}
+ </a></b>
+
{{- partial "menu/new-or-up.html" (dict "page" $pageItem) }}
{{ $item.Post }}
{{- end}}
diff --git a/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_150x0_resize_q75_h2_box_3.webp b/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_150x0_resize_q75_h2_box_3.webp
new file mode 100644
index 0000000..3b43a10
--- /dev/null
+++ b/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_150x0_resize_q75_h2_box_3.webp
Binary files differ
diff --git a/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_300x0_resize_q75_h2_box_3.webp b/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_300x0_resize_q75_h2_box_3.webp
new file mode 100644
index 0000000..ecb18de
--- /dev/null
+++ b/resources/_gen/images/content_images/me-grim_hu854d4979f24f44fb1730c3fab6c9ef4f_4533_300x0_resize_q75_h2_box_3.webp
Binary files differ