From 07f02303073818457f96579a521dcace3826e719 Mon Sep 17 00:00:00 2001 From: sloane <1699281+sloanelybutsurely@users.noreply.github.com> Date: Sat, 24 Feb 2024 21:48:47 -0500 Subject: [PATCH] fix rel="me" links on home page --- lib/sloane_sh/layouts/helpers.ex | 43 +++++++++++++++++++------------- priv/site/pages/home.md.eex | 10 +++++--- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/lib/sloane_sh/layouts/helpers.ex b/lib/sloane_sh/layouts/helpers.ex index 603177b..80a11a9 100644 --- a/lib/sloane_sh/layouts/helpers.ex +++ b/lib/sloane_sh/layouts/helpers.ex @@ -24,33 +24,40 @@ defmodule SloaneSH.Layouts.Helpers do end def picture(ctx, src, alt \\ "", class \\ "") do - image = Enum.find(ctx.images, fn i -> - output = OutputDirs.image(ctx.config, i.src) - src == OutputDirs.to_permalink(ctx.config, output) - end) + image = + Enum.find(ctx.images, fn i -> + output = OutputDirs.image(ctx.config, i.src) + src == OutputDirs.to_permalink(ctx.config, output) + end) if is_nil(image) do Logger.warning("Could not find #{inspect(src)} to make picture element") ~s|#{alt}| else - [{_, src} | srcsets] = [ - {"image/jpg", ".jpg"}, - {"image/webp", ".webp"}, - {"image/png", ".png"}, - ] + [{_, src} | srcsets] = + [ + {"image/jpg", ".jpg"}, + {"image/webp", ".webp"}, + {"image/png", ".png"} + ] |> Enum.map(fn {type, ext} -> {type, OutputDirs.replace_ext(src, ext)} end) - - EEx.eval_string(~S""" - - <%= for {type, srcset} <- srcsets do %> - - <% end %> - <%= alt %> - - """, src: src, srcsets: srcsets, alt: alt, class: class) + EEx.eval_string( + ~S""" + + <%= for {type, srcset} <- srcsets do %> + + <% end %> + <%= alt %> + + """, + src: src, + srcsets: srcsets, + alt: alt, + class: class + ) end end end diff --git a/priv/site/pages/home.md.eex b/priv/site/pages/home.md.eex index f154bdd..3d272f2 100644 --- a/priv/site/pages/home.md.eex +++ b/priv/site/pages/home.md.eex @@ -7,9 +7,11 @@ hey, i'm sloane! i'm a professional software engineer and an amateur musician, p ### around the web -- @sloane on the fediverse -- [@sloanelybutsurely](https://github.com/sloanelybutsurely) on github -- [@sloane_of_arc](https://instagram.com/sloane_of_arc) on instagram + ### writing @@ -22,6 +24,6 @@ i write more than i share but here are some things that have made it out of my d ### projects -#### 🌱 [screen.garden](https://screen.garden) +

🌱 screen.garden

real-time collaboration across obsidian and the web. currently in closed beta.