1
0
Fork 0

readme-generator: only pick files (no folder) on the root of 'screenshots'

This commit is contained in:
OniriCorpe 2024-03-13 02:45:34 +01:00 committed by OniriCorpe
parent 8443f18b22
commit 775c6ef627
3 changed files with 7 additions and 5 deletions

View file

@ -83,11 +83,13 @@ def generate_READMEs(app_path: Path):
screenshots: List[str]
if (app_path / "doc" / "screenshots").exists():
screenshots = os.listdir(os.path.join(app_path, "doc", "screenshots"))
screenshots = []
# only pick files (no folder) on the root of 'screenshots'
for entry in os.scandir(os.path.join(app_path, "doc", "screenshots")):
if os.DirEntry.is_file(entry):
screenshots.append(os.path.relpath(entry.path, app_path))
if ".gitkeep" in screenshots:
screenshots.remove(".gitkeep")
else:
screenshots = []
disclaimer: Optional[str]
if (app_path / "doc" / f"DISCLAIMER{lang_suffix}.md").exists():

View file

@ -42,7 +42,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Screenshots
{% for screenshot in screenshots -%}
![Screenshot of {{manifest.name}}](./doc/screenshots/{{screenshot}})
![Screenshot of {{manifest.name}}](./{{screenshot}})
{% endfor %}
{% endif -%}

View file

@ -28,7 +28,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
## Captures décran
{% for screenshot in screenshots -%}
![Capture décran de {{manifest.name}}](./doc/screenshots/{{screenshot}})
![Capture décran de {{manifest.name}}](./{{screenshot}})
{% endfor %}
{% endif -%}