distributed-wikipedia-mirror
distributed-wikipedia-mirror copied to clipboard
fix: main page in case it was created from exception
This fixes the issues that affected Belarusian wiki for example - https://github.com/ipfs/distributed-wikipedia-mirror/pull/120
In case of Belarusian wiki, the main page lands in exceptions. This means that in the resulting website it's available under wiki/main_page/index.html instead of wiki/main_page.
When it's copied to wiki/index.html, one depth level in relative links have to be removed.
Previously, we were looking at the input main page path to determine if relative links need to be fixed up. With this change, we will be looking at the actual path (e.g. after exceptions processing).
This fix was tested as part of https://github.com/ipfs/distributed-wikipedia-mirror/pull/123.
@lidel Should we merge this fix to make sure the wikis we want to create in the future have correct main pages set up?
The latest zimdump has a fix regarding main page teporting... maybe it has an impact here.
The latest zimdump has a fix regarding main page teporting... maybe it has an impact here.
Either way, options.kiwixMainPage refers to the user-provided main page path while kiwixMainPageSrc would refer to the actual path that we end up with. So even if the underlying issue in zimdump is already fixed, this PR corrects the semantics here.