Using a base uri is breaking linking to local images #235

Open
opened 2024-12-28 07:08:17 +00:00 by ken_fallon · 2 comments
Owner

With <base href="https://hackerpublicradio.org/"> set local images <a href="hpr4282_1.jpeg"> are not been displayed on a page https://hackerpublicradio.org/eps/hpr4282/index.html removing it and the css fails.

The eps.notes must have images linked locally and so displayed when the index page for the episode is displayed.

After the redesign the only place the shownotes will be displayed is on the epidode index page eps/hpr????/index.html, and the main page will only display a summary

With `<base href="https://hackerpublicradio.org/">` set local images `<a href="hpr4282_1.jpeg">` are not been displayed on a page https://hackerpublicradio.org/eps/hpr4282/index.html removing it and the css fails. The `eps.notes` must have images linked locally and so displayed when the index page for the episode is displayed. After the redesign the only place the shownotes will be displayed is on the epidode index page `eps/hpr????/index.html`, and the main page will only display a summary
Owner

I see the issue. The <link href="./css/hpr.css" rel="stylesheet" /> should be <link href="/css/hpr.css" rel="stylesheet" /> (i.e. don't use a relative path but absolute path). That should fix when using the base href. Although the setting the base should really only be done when trying to view files locally through your browser and not viewing through a webserver.

I will take a look at this and put in a PR when I have a tested fix.

I see the issue. The &lt;link href="./css/hpr.css" rel="stylesheet" /&gt; should be &lt;link href="/css/hpr.css" rel="stylesheet" /&gt; (i.e. don't use a relative path but absolute path). That should fix when using the base href. Although the setting the base should really only be done when trying to view files locally through your browser and not viewing through a webserver. I will take a look at this and put in a PR when I have a tested fix.
Owner

I haven't test, but thinking about the issue and things observed while developing the generator, when using the base tag then any relative src or href paths need to be relative to the href set in the base tag. So either the img or a needs the full path relative to the base or the base path for that page must include the path to the relative folder.

I haven't test, but thinking about the issue and things observed while developing the generator, when using the base tag then any relative src or href paths need to be relative to the href set in the base tag. So either the img or a needs the full path relative to the base or the base path for that page must include the path to the relative folder.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HPR/hpr_generator#235
No description provided.