readme-generator: only pick files (no folder) on the root of 'screenshots'
This commit is contained in:
parent
8443f18b22
commit
775c6ef627
3 changed files with 7 additions and 5 deletions
|
@ -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():
|
||||
|
|
|
@ -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 -%}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Si vous n’avez 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 -%}
|
||||
|
||||
|
|
Loading…
Reference in a new issue