Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Homepage should focus on the proper location and zoom (#55)
- Fix prettier and eslint check in zimui QA CI (#85)
- Do not create a full-text index (#91)
- Add all possibilites in suggestion index when disambiguation page is used (#92)

## [0.1.1] - 2026-03-10

Expand Down
18 changes: 9 additions & 9 deletions scraper/src/maps2zim/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,32 +1438,32 @@ def _write_places(
self._report_progress()
last_log_time = current_time

path = f"search/{name}"
root_prefix = "../" * path.count("/")
if len(places) == 1:
# Single place: create redirect
place = places[0]
for place in places:
# Create one HTML redirect per place
path = f"search/{place.label}"
root_prefix = "../" * path.count("/")
redirect_html = self._create_redirect_html(place, root_prefix)
creator.add_item_for(
path=path,
content=redirect_html.encode("utf-8"),
mimetype="text/html",
title=name,
title=place.label,
)
redirect_count += 1
else:
if len(places) > 1:
# Multiple places: create disambiguation page
path = f"search/{name} (disambiguation)"
root_prefix = "../" * path.count("/")
disamb_html = self._create_disambiguation_html(
name, places, root_prefix
)
creator.add_item_for(
path=path,
content=disamb_html.encode("utf-8"),
mimetype="text/html",
title=name,
title=f"{name} (disambiguation)",
)
disamb_count += 1

logger.info(
f" Added {redirect_count} redirects and {disamb_count} "
f"disambiguation pages"
Expand Down
Loading