Skip to content

Commit c63f555

Browse files
authored
Merge pull request #130 from stedman/master
Fix avatar cache warming
2 parents 8a8bea2 + dd21554 commit c63f555

File tree

4 files changed

+40
-30
lines changed

4 files changed

+40
-30
lines changed

_includes/filters/markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ module.exports = (content) => {
1616
return md.render(content);
1717
}
1818

19-
return content;
19+
return '';
2020
};

_includes/shortcodes/avatar.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
const Image = require('@11ty/eleventy-img');
22

33
module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
4-
const stats = await Image(src, {
5-
cacheDuration: '12w',
6-
formats: [outputFormat],
7-
outputDir: '_site/assets/avatar/',
8-
widths: [96],
9-
});
4+
if (alt === undefined) {
5+
throw new Error(`Missing ALT attribute from: ${src}`);
6+
}
107

118
const classAttr = className ? `class="${className}"` : '';
129

13-
const props = stats[outputFormat].pop();
10+
try {
11+
const stats = await Image(src, {
12+
cacheDuration: '12w',
13+
formats: [outputFormat],
14+
outputDir: '_site/assets/avatar/',
15+
widths: [96],
16+
});
1417

15-
if (alt === undefined) {
16-
throw new Error(`Missing ALT attribute from: ${src}`);
17-
}
18+
const props = stats[outputFormat].pop();
1819

19-
return `<img ${classAttr} src="${props.outputPath.replace('_site', '')}" alt="${alt}" loading="lazy">`;
20+
return `<img ${classAttr} src="${props.outputPath.replace('_site', '')}" alt="${alt}" loading="lazy">`;
21+
} catch (err) {
22+
// eslint-disable-next-line no-console
23+
console.error(err);
24+
25+
return '';
26+
}
2027
};

_includes/social-links.liquid

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
{%- if person.email -%}
1+
{%- if person.email %}
22
<a class="icon tooltip" href="mailto:{{ person.email }}" title="Email: {{ person.email }}">
33
<ion-icon class="is-size-3" src="{{ '/assets/ionicon/at-circle.svg' | url }}"><i class="is-sr-only">email</i></ion-icon>
44
</a>
5-
{%- endif -%}
6-
{%- if person.homepage -%}
5+
{% endif -%}
6+
7+
{%- if person.homepage %}
78
<a class="icon tooltip" href="{{ person.homepage }}" title="Home: {{ person.homepage }}">
89
<ion-icon class="is-size-3" src="{{ '/assets/ionicon/home.svg' | url }}"><i class="is-sr-only">homepage</i></ion-icon>
910
</a>
10-
{%- endif -%}
11-
{%- if person.twitter -%}
11+
{% endif -%}
12+
13+
{%- if person.twitter %}
1214
<a class="icon tooltip" href="https://twitter.com/{{ person.twitter }}" title="Twitter: {{ person.twitter }}">
1315
<ion-icon class="is-size-3" src="{{ '/assets/ionicon/logo-twitter.svg' | url }}"><i class="is-sr-only">Twitter</i></ion-icon>
1416
</a>
15-
{%- endif -%}
16-
{%- if person.github -%}
17+
{% endif -%}
18+
19+
{%- if person.github %}
1720
<a class="icon tooltip" href="https://github.com/{{ person.github }}" title="GitHub: {{ person.github }}">
1821
<ion-icon class="is-size-3" src="{{ '/assets/ionicon/logo-github.svg' | url }}"><i class="is-sr-only">GitHub</i></ion-icon>
1922
</a>
20-
{%- endif -%}
21-
{%- if person.linkedin -%}
23+
{% endif -%}
24+
25+
{%- if person.linkedin %}
2226
<a class="icon tooltip" href="https://www.linkedin.com/in/{{ person.linkedin }}" title="LinkedIn: {{ person.linkedin }}">
2327
<ion-icon class="is-size-3" src="{{ '/assets/ionicon/logo-linkedin.svg' | url }}"><i class="is-sr-only">LinkedIn</i></ion-icon>
2428
</a>
25-
{%- endif -%}
29+
{% endif -%}

about.liquid

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ meta:
1111
<p>Austin JavaScript is a community that meets regularly to discuss JavaScript and the open web. The group started back in 2009, and it’s been going strong ever since. We cover a range of topics, including:</p>
1212
<ul>
1313
<li>The JavaScript language</li>
14-
<li>New features of the web platform</li>
15-
<li>JavaScript app frameworks</li>
16-
<li>Frontend ops</li>
17-
<li>Testing your code</li>
18-
<li>Running JavaScript in native apps</li>
19-
<li>Running JavaScript on the server</li>
20-
<li>Running JavaScript on other peoples sites</li>
14+
<li>JavaScript application frameworks</li>
15+
<li>Server and client-side JavaScript</li>
16+
<li>JavaScript on other people's sites</li>
17+
<li>Testing</li>
18+
<li>DevOps</li>
2119
<li>Cryptography</li>
2220
<li>How CSS colors got their names</li>
21+
<li>JavaScript position openings</li>
2322
</ul>
2423
<p>If you’d like to get more details on past topics, take a look at the <a href="/posts/meetups/">meetup archives</a>.</p>
2524

2625
<h2>How it usually works</h2>
27-
<p>We typically meet on the 3<sup>rd</sup> Tuesday of each month somewhere in central Austin, Texas -- typically downtown. We’ll have a speaker or two, open things up for questions and discussion, and then head to a nearby watering hole to continue the festivities.</p>
26+
<p>We typically meet on the 3<sup>rd</sup> Tuesday of each month somewhere in central Austin, Texas typically downtown. We’ll have a speaker or two, open things up for questions and discussion, and then head to a nearby watering hole to continue the festivities.</p>
2827

2928
<h2>Excellence</h2>
3029
<p>We work hard to build a community of like-minded people that treat each other with <em>excellence</em>. We’ve formalized what this means into our <a href="/code-of-conduct/">Code of Conduct</a>.</p>

0 commit comments

Comments
 (0)