diff --git a/docs/making-a-module.md b/docs/making-a-module.md index bc1ecbf50e..44dfad1c68 100644 --- a/docs/making-a-module.md +++ b/docs/making-a-module.md @@ -82,7 +82,7 @@ meta: - shamir - enderpuff - # Either null or a link to the YouTube video + # Either null or a link to the YouTube video. Not needed if there is no video video: null # Either null or a link to the wiki page wiki: https://wiki.gm4.co/wiki/Disassemblers diff --git a/gm4/plugins/readme_generator.py b/gm4/plugins/readme_generator.py index b442a88f26..94ea88010f 100644 --- a/gm4/plugins/readme_generator.py +++ b/gm4/plugins/readme_generator.py @@ -119,8 +119,8 @@ def beet_default(ctx: Context, opts: ManifestConfig): }) # Modrinth Youtube Video Embed - if (vid_url:=ctx.meta['gm4']['video']) is not None: - embed_url = re.sub(r'https:\/\/www.youtube.com\/watch\?v=(\w+)', r'https://www.youtube.com/embed/\1', vid_url) + if 'video' in ctx.meta['gm4'] and ctx.meta['gm4']['video'] is not None: + embed_url = re.sub(r'https:\/\/www.youtube.com\/watch\?v=(\w+)', r'https://www.youtube.com/embed/\1', ctx.meta['gm4']['video']) site_replacements["modrinth"].update({ r"(.+)