Skip to content

Commit d1f904a

Browse files
rowanmanningwesleytoddbjohansebasShubhamOulkar
authored
Display author avatars in the blog (#1915)
* feat: allow blogs to have multiple authors This requires us to update the `author` front-matter, requiring it to be an array of objects instead of a single string. This paves the way for us to include further author metadata. For now we only add "name" which expects a string. * feat: allow linking to author GitHub profiles This adds the ability for authors to add their GitHub username to the blog posts they author. If they provide this then their name will be linked to their GitHub profile page. * feat: add GitHub profile images to author lines This adds a small profile image to author lines that have a GitHub. * feat: add author URLs to the feeds * fix: space the authors a little more The authors looked a little bunched up, a left margin on each of them reads a little better. Co-Authored-By: Wes Todd <wesleytodd@users.noreply.github.com> * fix: improve readability of the feed entry Liquid Co-Authored-By: Sebastian Beltran <bjohansebas@users.noreply.github.com> * feat: add author image for the technical committee Co-Authored-By: Sebastian Beltran <bjohansebas@users.noreply.github.com> * fix: set a width and height on author images This ensures we still display a circle if, for some reason, the image that we get isn't a perfect square. Co-Authored-By: Shubham Oulkar <ShubhamOulkar@users.noreply.github.com> --------- Co-authored-by: Wes Todd <wesleytodd@users.noreply.github.com> Co-authored-by: Sebastian Beltran <bjohansebas@users.noreply.github.com> Co-authored-by: Shubham Oulkar <ShubhamOulkar@users.noreply.github.com>
1 parent b460ccb commit d1f904a

16 files changed

Lines changed: 93 additions & 23 deletions

_includes/blog/authors.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{%- assign authors = include.authors -%}
2+
{% if authors %}
3+
<div class="blog-authors">
4+
By
5+
{% for author in authors %}
6+
7+
{%- assign label = author.github | prepend: '@' -%}
8+
{%- if author.name -%}
9+
{%- assign label = author.name -%}
10+
{%- endif -%}
11+
12+
{% if label and author.github %}
13+
<a href="https://github.com/{{author.github}}" rel="author" class="blog-author-link">
14+
<img src="https://github.com/{{author.github}}.png?size=64" alt="" class="blog-author-avatar" />
15+
<span class="blog-author-link-label">{{label}}</span></a>{% unless forloop.last %}, {% endunless %}
16+
{% elsif label %}
17+
{{label}}{% unless forloop.last %}, {% endunless %}
18+
{% endif %}
19+
{% endfor %}
20+
</div>
21+
{% endif %}

_includes/feed-entry.xml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
<id>{{ site.url }}{{ entry.url }}</id>
44
<link href="{{ site.url }}{{ entry.url }}" rel="alternate" type="text/html" />
55
<title type="text">{{ entry.title }}</title>
6-
{%- if entry.author %}
7-
<author>
8-
<name>{{ entry.author }}</name>
9-
</author>
10-
{%- endif %}
6+
{%- for author in entry.authors %}
7+
<author>
8+
{% if author.name %}
9+
<name>{{ author.name }}</name>
10+
{% elsif author.github %}
11+
<name>@{{ author.github }}</name>
12+
{% endif %}
13+
{% if author.github %}
14+
<uri>https://github.com/{{ author.github }}</uri>
15+
{% endif %}
16+
</author>
17+
{%- endfor %}
1118
<published>{{ entry.date | date_to_xmlschema }}</published>
1219
<updated>{{ entry.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
1320
{%- for tag in post.tags %}

_includes/head.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4141
<meta name="description" content="{{page.description}}">
4242
<meta property="og:url" content="https://expressjs.com{{page.url}}">
43-
{% if page.author %}
44-
<meta property="og:type" content="article">
45-
<meta property="og:article:author" content="{{page.author}}">
43+
{% if page.authors %}
44+
<meta property="og:type" content="article">
45+
{%- for author in page.authors %}
46+
<meta property="og:article:author" content="{{author.name}}">
47+
{%- endfor %}
4648
{% else %}
4749
<meta property="og:type" content="website">
4850
{% endif %}

_layouts/post.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ <h1>{{page.title}}</h1>
2121
<h2>{{page.sub_title}}</h2>
2222
{% endif %}
2323
<div class="blog-details">
24-
{% if page.author %}
25-
<div class="blog-author">By {{page.author}}</div>
26-
{% endif %}
24+
{% include blog/authors.html authors=page.authors %}
2725
<div class="blog-date">{{page.date| date: "%d %b %Y" }}</div>
2826
</div>
2927
{{ content }}

_posts/2024-07-16-welcome-post.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
title: Welcome to The Express Blog!
33
description: Introducing the new Express blog — a primary platform for announcements, updates, and communication from the Express technical committee.
44
tags: site-admin
5-
author: Rand McKinney and Chris Del
5+
authors:
6+
- name: Rand McKinney
7+
github: crandmck
8+
- name: Chris Del
9+
github: chrisdel101
610
---
711

812
Welcome to the new Express blog! The blog is meant to be a primary means of communication for the Express technical committee (TC). While we currently have other channels such as X, LinkedIn, and of course GitHub, there's no authoritative "soapbox" for announcements and general communication.

_posts/2024-09-29-security-releases.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: September 2024 Security Releases
33
description: Security releases for Express, body-parser, send, serve-static, and path-to-regexp have been published. We recommend that all users upgrade as soon as possible.
44
tags: security vulnerabilities
5-
author: Ulises Gascón
5+
authors:
6+
- name: Ulises Gascón
7+
github: UlisesGascon
68
---
79

810
Recently, the Express team has been made aware of a number of security vulnerabilities in the Express project. We have released a number of patches to address these vulnerabilities.

_posts/2024-10-01-HeroDevs-partnership-announcement.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: Express Never Ending Support Launched by HeroDevs and Express.js
33
description: The Express.js team is pleased to announce a partnership with HeroDevs to launch Express Never-Ending Support (NES), providing long-term support for applications built with legacy Express. This collaboration ensures that developers relying on older versions of the framework will continue to receive critical security and compatibility updates, allowing them to maintain and scale their applications securely, even after the framework's official end-of-life.
44
tags: partnerships announcements
5-
author: Express Technical Committee
5+
authors:
6+
- name: Express Technical Committee
7+
github: expressjs
68
---
79

810
The Express.js team is pleased to announce a partnership with HeroDevs to launch [Express Never-Ending Support (NES)](https://www.herodevs.com/support/express-nes), providing long-term support for applications built with legacy Express. This collaboration ensures that developers relying on older versions of the framework will continue to receive critical security and compatibility updates, allowing them to maintain and scale their applications securely, even after the framework's official end-of-life.

_posts/2024-10-15-v5-release.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
22
title: "Introducing Express v5: A New Era for the Node.js Framework"
33
tags: releases
4-
author: Wes Todd and the Express Technical Committee
4+
authors:
5+
- name: Wes Todd
6+
github: wesleytodd
7+
- name: Express Technical Committee
8+
github: expressjs
59
description: Announcing the release of Express version 5
610
---
711

_posts/2024-10-22-security-audit-milestone-achievement.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: "Express.js Security Audit: A Milestone Achievement"
33
tags: security audit releases
4-
author: Express Technical Committee
4+
authors:
5+
- name: Express Technical Committee
6+
github: expressjs
57
description: Celebrating the successful completion of the Express.js security audit conducted by Ada Logics and facilitated by OSTIF.
68
---
79

_posts/2025-01-09-rewind-2024-triumphs-and-2025-vision.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
title: "A New Chapter for Express.js: Triumphs of 2024 and an ambitious 2025"
33
tags: news rewind 2024
4-
author: Express Technical Committee
4+
authors:
5+
- name: Express Technical Committee
6+
github: expressjs
57
description: Explore the transformative journey of Express.js in 2024, marked by governance improvements, the long-awaited release of Express 5.0, and heightened security measures. Look into the ambitious plans for 2025, including performance optimizations, scoped packages, and a bold roadmap for sustained growth in the Node.js ecosystem.
68
---
79

0 commit comments

Comments
 (0)