Exporting to HTML - Index page linking is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zim |
Fix Committed
|
Undecided
|
Unassigned | ||
zim (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I'm using Zim 0.65 in Windows 10 and there's a problem exporting to HTML with:
1 Complete notebook
2. Default_
3. Each page to a separate file
4. An index page named "index" is specified
The problem is that all index page links are generated as:
<a href='index'
The index page is sucessfully generated as "index.html" in the same folder as the root page, but the index page links have no ".html" extension and they are interpreted as relative to the current page.
I attach a test notebook and generated html.
Santiago
Thanks
NOTE. Yesterday I thought that it is the same bug as in https:/
I'm in a hurry and I have programmed a turnaround in the default_with_index template.
In advance warn that I'm a programmer but not a Phyton programmer, and that the template phyton language subset is very restricted.
The turnaround is somewhat tricky because it uses in a tricky way the only function that returns a current page relative uri: resource (maybe there is other function that returns it but I only found this).
The trick consists in get the address of a dummy resource and then replace the part of the address corresponding to the dummy resource by the index one.
To use the turnaorund, in the default_whith_index template replace the code that generates the index link by:
[% SET indexPage= links.get( "index" ) %] resource( "dummy" ) %] dummyURL. replace( "_resources/ dummy", "") %] insen'> Index</ span> ]
[% IF indexPage %]
[% SET dummyURL=
[% SET indexURL=
[ <a href='[% indexURL %][% indexPage %].html'>Index</a> ]
[% ELSE %]
[ <span class='
[% END %]
Notes:
1. You don't need to have a resources folder with the template name to obtain the dummy relative path
2. Maybe it seems strange to not directly replace the address of the index, but apparently the functions only supports literals.
I attach a test notebook, the default_with_index template renamed as Default_ with_index_ dummyTrick and modified and generated html where the index links works in all pages.
Santiago