distributed-wikipedia-mirror icon indicating copy to clipboard operation
distributed-wikipedia-mirror copied to clipboard

fix: main page in case it was created from exception

Open galargh opened this issue 3 years ago • 3 comments

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.

galargh avatar Mar 14 '22 16:03 galargh

@lidel Should we merge this fix to make sure the wikis we want to create in the future have correct main pages set up?

galargh avatar May 13 '22 08:05 galargh

The latest zimdump has a fix regarding main page teporting... maybe it has an impact here.

kelson42 avatar May 13 '22 09:05 kelson42

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.

galargh avatar May 13 '22 10:05 galargh