Skip to content

Commit

Permalink
Add new shortcode for availability, better words
Browse files Browse the repository at this point in the history
  • Loading branch information
jegtnes committed Feb 29, 2024
1 parent 62f39b7 commit 812926f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const EleventyVitePlugin = require("@11ty/eleventy-plugin-vite");

const activeSection = require("./src/_shortcodes/active-section");
const ariaCurrent = require("./src/_shortcodes/aria-current");
const availability = require("./src/_shortcodes/availability");

const { humanPostDate, isoPostDate } = require("./src/_filters/date");

Expand All @@ -18,6 +19,7 @@ module.exports = function (eleventyConfig) {

eleventyConfig.addShortcode("activeSection", activeSection);
eleventyConfig.addShortcode("ariaCurrent", ariaCurrent);
eleventyConfig.addShortcode("availability", availability);

eleventyConfig.addFilter("humanPostDate", humanPostDate);
eleventyConfig.addFilter("isoPostDate", isoPostDate);
Expand Down
1 change: 0 additions & 1 deletion src/_data/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"availability": true,
"availabilityDate": "from March 2024 onwards",
"baseUrl": "https://jegtnes.com",
"siteName": "Alex Jegtnes",
"twitter": "@jegtnes"
Expand Down
13 changes: 13 additions & 0 deletions src/_shortcodes/availability.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = function availability(availability, availabilityString, short = false) {
if (short) {
if (!availability) return "None currently";
if(availabilityString && availabilityString.length) return `from ${availabilityString}`;
return "Currently available";
}

if (!availability) return "I presently have no availability for new engagements.";

if(availabilityString && availabilityString.length) return `<strong>I have availability for new engagements from ${availabilityString}</strong>, either remotely or on-site in London.`;

return "<strong>I have current availability for new engagements</strong>, either remotely or on-site in London.";
};
2 changes: 2 additions & 0 deletions src/_styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ nav ul li {
margin-block-end: var(--space-m);
width: 100%;
max-width: 20em;
height: auto;
width: auto;
}

.container__full-bleed,
Expand Down
7 changes: 4 additions & 3 deletions src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ layout: page.njk
introHalfBleed: true
eleventyComputed:
intro:
<img src="/assets/images/face.jpg" class="image-inline" alt="A photo of me, cropped at just below the shoulders. I have shoulder-length, wavy, blond hair, blue eyes, and wearing black, rounded rectangular glasses." />
<p>I'm an independent web development contractor based in London with ten years of experience. I develop fast, accessible, and beautiful websites and web apps.</p>
<img src="/assets/images/face.jpg" width="700" height="875" class="image-inline" alt="A photo of me, cropped at just below the shoulders. I have shoulder-length, wavy, blond hair, blue eyes, and wearing black, rounded rectangular glasses." />
<p>I'm an independent web development contractor based in London with ten years of experience. I develop fast, accessible, and beautiful websites and web apps for everything from small design studios to banks and newspapers.</p>
<p>At the heart of my approach is facilitating excellent cross-team communication without getting bogged down in bike-shedding, breaking down barriers to collaboration, and helping find that ever-tricky balance between perfection and shipping.</p>
{% if global.availability %}
<p><strong>I have availability for new projects {{ global.availabilityDate }}</strong>, either remotely or on-site in London.</p>
<p>{% availability global.availability, global.availabilityString %}</p>
<a class="btn" href="/work-with-me#quick-summary">See what I can do for your organisation</a>
{% endif %}
---
Expand Down
6 changes: 3 additions & 3 deletions src/work-with-me.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ layout: page.njk
description: Hire Alex Jegtnes, a versatile freelance front-end developer with ten years of experience working for everything from small design studios to banks and newspapers.
eleventyComputed:
twitterLabel1: Availability
twitterData1: "{%if global.availability%}{{global.availabilityDate}}{%else%}None{%endif%}"
twitterData1: "{% availability global.availability, global.availabilityString, true %}"
twitterLabel2: Proficiencies
twitterData2: JavaScript, well-crafted HTML & CSS, accessibility, React, web performance
intro: <p>Hi there! I'm Alex, an independent web development contractor based in London. I develop fast, accessible, and beautiful websites and web apps.</p>{% if global.availability %}<p><strong>I have availability for new projects {{ global.availabilityDate }}</strong>, either remotely or on-site in London.</p><p>I have ten years of experience working with clients ranging from startups and design studios to large corporations and banks. Read on to find out what I can bring to your organisation.</p>{% endif %}
intro: <p>Hi there! I'm Alex, an independent web development contractor based in London. I develop fast, accessible, and beautiful websites and web apps.</p>{% if global.availability %}<p><p>{% availability global.availability, global.availabilityString %}</p></p><p>I have ten years of experience working with clients ranging from startups and design studios to large corporations and banks. Read on to find out what I can bring to your organisation.</p>{% endif %}
---

## Quick summary
Expand Down Expand Up @@ -96,6 +96,6 @@ Speaking of responsive images, in the dark days when responsive images weren't n

## Let's make a nice website together?

If my skills sound relevant to anything you need help with I'd love to hear from you and to discuss your next project.
If my skills sound relevant to anything you need help with, I'd love to hear from you and to discuss your next project.

<a class="btn" href="mailto:[email protected]?subject=Contracting%20inquiry">Toss an email my way!</a>

0 comments on commit 812926f

Please sign in to comment.