Skip to content

Commit f3867fd

Browse files
committed
allow image url, rename logo to image
1 parent d502386 commit f3867fd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

authors/singlestore.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name="SingleStore"
22
title="Engineering Team"
3-
logo="singlestore"
3+
image="singlestore"
44
external=false

resources/author-check.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python3
22
import os
3+
import re
34
import sys
45
import tomllib
56

6-
77
def error(msg):
88
print('ERROR:', msg, file=sys.stderr)
99
sys.exit(1)
@@ -24,13 +24,17 @@ def check_author(author_path):
2424
if 'external' not in meta:
2525
error(f'No `external` in `meta` section of {author_path}')
2626

27-
# Logo is optional, but if defined a corresponding image must exist
28-
if 'logo' in meta:
29-
logo_id = meta['logo']
30-
logo_filename = f'{logo_id}.png'
31-
logo_path = os.path.join('common/images/author-images', logo_filename)
32-
if not os.path.isfile(logo_path):
33-
error(f'Logo image does not exist at {logo_path} for {author_path}')
27+
# Image is optional, but if defined a corresponding image must exist
28+
# Image can either be a URL or a filename in common/images/author-images
29+
if 'image' in meta:
30+
img_reference = meta['image']
31+
is_url = bool(re.match(r'^https?://', img_reference))
32+
33+
if (not is_url):
34+
img_filename = f'{img_reference}.png'
35+
img_path = os.path.join('common/images/author-images', img_filename)
36+
if not os.path.isfile(img_path):
37+
error(f'Author image does not exist at {img_path} for {author_path}')
3438

3539

3640
if __name__ == '__main__':

0 commit comments

Comments
 (0)