Adjust add-on README logo (#2381)

Currently, the `<AddonLogo />` component is inserted as the first child into the readme,
which causes styling issues.
It instead needs to be put after the heading.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
pull/2430/head
Florian Hotze 2024-10-01 21:06:46 +02:00 committed by GitHub
parent 9077355dad
commit a1eed13e94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -95,10 +95,13 @@ def process_addon_type = { features, sources, type, collection, suffix, lblremov
} }
front = front + feature front = front + feature
def toYaml = { '---\n' + it.collect{ /$it.key: $it.value/ }.join('\n') + '\n---\n\n' } def toYaml = { '---\n' + it.collect{ /$it.key: $it.value/ }.join('\n') + '\n---\n\n' }
def heading = readme.text.find(/# .*/)
def text = readme.text.replace(heading, '')
readme.write(toYaml(front) readme.write(toYaml(front)
+ '<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->\n\n{% include base.html %}\n\n' + '<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->\n\n{% include base.html %}\n\n'
+ ((logo_svg || logo_png) ? '<AddonLogo />\n\n' : '') + heading
+ readme.text) + ((logo_svg || logo_png) ? '\n\n<AddonLogo />' : '')
+ text)
} }
} }
print "\n" print "\n"