LiaScript / LiaScript-Exporter

Export LiaScript courses into SCORM1.2 & 2004, IMS, PDF or a standalone WEB project ...
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Relative path not recognized after exporting in the 'web' format #18

Closed rkttu closed 3 years ago

rkttu commented 3 years ago

When content is exported in web format, if you view the content in the subdirectory with a web browser, the relative path is not recognized and the image is not loaded properly because it changes to an absolute path.

For example, in the README.md file, add the image as follows:

![Figure](images/image01.png)

The folder structure is as follows.

image

In a real website, it tries to find the image at the root by prefixing it with a '/' character, without considering that it is a relative path as shown in the figure below. So I get a 404 error.

image

andre-dietrich commented 3 years ago

Hi, I see the problem ... I have to think about the way and the possibilities of how the root path of a course is determined. But you can simply fix this problem locally, for now.

You can simply overwrite the global base with the following macro, simply add base: ./ into the main-header of your document and all images and relatives paths should use this as the root ... resulting in ./images/image01.png ...

<!--
comment: ...

base: ./

-->

# main title

Actually it should not interfere with future solutions, since the urls should work properly in any case ...

rkttu commented 3 years ago

Problem has gone. Thank you. 👍