File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 11name =" SingleStore"
22title =" Engineering Team"
3- logo =" singlestore"
3+ image =" singlestore"
44external =false
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22import os
3+ import re
34import sys
45import tomllib
56
6-
77def 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
3640if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments