all repos — homestead @ 16688c921d6649609228b6cdba2e10f67bbd498c

Code for my website

Template "elsewhere on the internet" links

Alan Pearce
commit

16688c921d6649609228b6cdba2e10f67bbd498c

parent

91fa16ebbc4bae704fbcce73d1ab9e1861d1c2e2

2 files changed, 14 insertions(+), 30 deletions(-)

jump to
M src/templates.tssrc/templates.ts
@@ -69,6 +69,16 @@ .attr("datetime", post.date.toISOString())
.text(post.date.toISOString().slice(0, 10)); $post.appendTo($feed); } + + $(".u-email").attr("href", `mailto:${config.email}`).text(config.email); + const $elsewhere = $(".elsewhere"); + const $linkRelMe = $elsewhere.find(".u-url[rel=me]").parentsUntil("ul"); + $linkRelMe.remove(); + for (const link of config.menus.me) { + const $link = $linkRelMe.clone(); + $link.find("a").attr("href", link.url).text(link.name); + $link.appendTo($elsewhere); + } return $.html(); }
M templates/homepage.htmltemplates/homepage.html
@@ -44,39 +44,13 @@ </ul>
</section> <section> <h2>Elsewhere on the Internet</h2> - <ul> - <li> - <a class="u-email" rel="me" href="mailto:alan@alanpearce.eu" - >alan@alanpearce.eu</a - > - </li> - <li> - <a class="u-url" rel="me" href="https://codeberg.org/alanpearce/" - >Codeberg</a - > - </li> - <li> - <a class="u-url" rel="me" href="https://github.com/alanpearce/" - >GitHub</a - > - </li> + <ul class="elsewhere"> <li> - <a class="u-url" rel="me" href="https://gitlab.com/alanpearce/" - >GitLab</a - > - </li> + <a class="u-email" rel="me" href="mailto:user@example.com" + >user@example.com</a></li> <li> - <a class="u-url" rel="me" href="https://ieji.de/@alanpearce" - >Mastodon</a - > + <a class="u-url" rel="me" href="http://example.com">Example</a> </li> - <li> - <a - class="u-url" - rel="me" - href="https://bsky.app/profile/alanpearce.eu" - >Bluesky</a - > </li> </ul> </section>