Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rahti preview does not handle absolute html links correctly #141

Open
Nortamo opened this issue Oct 2, 2019 · 1 comment
Open

Rahti preview does not handle absolute html links correctly #141

Nortamo opened this issue Oct 2, 2019 · 1 comment
Labels
low priority Matter is not so urgent, or the discussion is complete but the issue is not yet closed

Comments

@Nortamo
Copy link
Collaborator

Nortamo commented Oct 2, 2019

Absolute html links of the form /img/cyberduck_connect.PNG start from the root of the webpage, so basicly the site folder.

So in docs.csc.fi, the link /img/cyberduck_connect.PNG would resolve to
docs.csc.fi/img/cyberduck_connect.PNG and it works.

However, in the preview (csc-guide-preview.rahtiapp.fi/origin/name-of-branch) the same link
will resolve to csc-guide-preview.rahtiapp.fi/img/cyberduck_connect.PNG
which is not a valid path and no picture will be shown

No that critical, but just keep in mind that the preview might not display all images if they are using absolute paths. Quick fix is to just use relative paths for images.

@Nortamo Nortamo added the low priority Matter is not so urgent, or the discussion is complete but the issue is not yet closed label Oct 2, 2019
@joonas-somero
Copy link
Member

It is stated in the documentation for MkDocs, that

[...] as all raw HTML is ignored by the Markdown parser, MkDocs is not able to validate or convert links contained in raw HTML. [...]

Absolute Markdown links are not supported in MkDocs. There is a 'Warning' on the same page.

There is the setting site_url that could be used to mimic the Rahti preview when running the development server locally. Done either by editing mkdocs.yml or, after we've updated MkDocs to >=1.5, by starting the server with

echo '{INHERIT: mkdocs.yml, site_url: "https://csc-guide-preview.rahtiapp.fi/origin/"}' | mkdocs serve -f -

Of course it doesn't make much sense to mimic preview, when we're aiming for links to work in production, but this could perhaps be used in debugging, i.e. as a quick way to locally check if some issue arises from the difference in the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Matter is not so urgent, or the discussion is complete but the issue is not yet closed
Projects
None yet
Development

No branches or pull requests

2 participants