Relative links aren't working on "Stuff you need to know" page #172

Open
opened 2023-10-05 03:50:52 +00:00 by dnt · 5 comments

I noticed that in https://hackerpublicradio.org/stuff_you_need_to_know.html the heading links, which on this page are the full stop at the end of each heading, are all redirecting to the desired id on the home page https://hackerpublicradio.org/ rather than the current page.

This seems to be because of page.tpl.html line 8, , which expects the current page url, not the site's base url, and seems to be what the browser uses for relative links. Perhaps it's good enough to just get rid of the base element altogether, I haven't set up my environment to run this, so I can't test it right now.

I noticed that in https://hackerpublicradio.org/stuff_you_need_to_know.html the heading links, which on this page are the full stop at the end of each heading, are all redirecting to the desired id on the home page https://hackerpublicradio.org/ rather than the current page. This seems to be because of page.tpl.html line 8, <base href="<!--% baseurl %-->">, which expects the current page url, not the site's base url, and seems to be what the browser uses for relative links. Perhaps it's good enough to just get rid of the base element altogether, I haven't set up my environment to run this, so I can't test it right now.
Collaborator

I see what you mean (I think).

If I go to the main about page and click on Stuff you need to know. I am sent to https://hackerpublicradio.org/about.html#agreement.

However, the (rather strange) full-stop link wants to go to the incorrect link https://hackerpublicradio.org/#agreement.

I'm not clear why the destination of a link like this needs to contain a link that moves to the place you just arrived at, but maybe there's a good reason I don't understand.

I see what you mean (I think). If I go to the main [`about`](https://hackerpublicradio.org/about.html) page and click on *Stuff you need to know.* I am sent to [https://hackerpublicradio.org/about.html#agreement](https://hackerpublicradio.org/about.html#agreement). However, the (rather strange) full-stop link wants to go to the incorrect link [https://hackerpublicradio.org/#agreement](https://hackerpublicradio.org/#agreement). I'm not clear why the destination of a link like this needs to contain a link that moves to the place you just arrived at, but maybe there's a good reason I don't understand.
Collaborator

Given:

<h1 id="agreement">Stuff you need to know<a href="#agreement">.</a></h1>

I would be inclined to drop the <a> tag entirely:

<h1 id="agreement">Stuff you need to know.</h1>

Maybe I'm missing some deep HTML magic here though.

Given: ``` <h1 id="agreement">Stuff you need to know<a href="#agreement">.</a></h1> ``` I would be inclined to drop the `<a>` tag entirely: ``` <h1 id="agreement">Stuff you need to know.</h1> ``` Maybe I'm missing some deep HTML magic here though.
Collaborator

https://hackerpublicradio.org/stuff_you_need_to_know.html should not be on the site any more. It is replaced with https://hackerpublicradio.org/about.html#agreement. This is in an effort to consolidate the documentation as much as possible into the about page.

The full stop is (supposed to be) a self reference to click on to bring it to the same place. This is for when I need to point someone to the documentation and I need a link to that exact location.

Action items for me

  • The unused pages need to be removed
  • Implement redirects to the about page
  • Confirm all the links work
https://hackerpublicradio.org/stuff_you_need_to_know.html should not be on the site any more. It is replaced with https://hackerpublicradio.org/about.html#agreement. This is in an effort to consolidate the documentation as much as possible into the about page. The full stop is (supposed to be) a self reference to click on to bring it to the same place. This is for when I need to point someone to the documentation and I need a link to that exact location. Action items for me - [ ] The unused pages need to be removed - [ ] Implement redirects to the about page - [ ] Confirm all the links work
Collaborator

I still don't get the full-stop link. In order to click it you have to have the header it's attached to on the page. Clicking it leaves you where you already are! OK, it might shift the page so the header is at the top of the screen but I don't see the point of that!

The actual link target is the id=agreement in the header tag. In the new about page there's a nice menu at the top that contains links with all of these "fragments". Personally I think that's enough.

As I said, maybe I don't use anything where this is a highly desirable feature, but to me it's a waste of effort.

I still don't get the full-stop link. In order to click it you have to have the header it's attached to on the page. Clicking it leaves you where you already are! OK, it might shift the page so the header is at the top of the screen but I don't see the point of that! The actual link target is the `id=agreement` in the header tag. In the new `about` page there's a nice menu at the top that contains links with all of these "fragments". Personally I think that's enough. As I said, maybe I don't use anything where this is a highly desirable feature, but to me it's a waste of effort.
Collaborator

It's there on request of the biggest user of the page by far, namely me.

The menus at the top of the page contains only 14 of the 96 links on the page (and is missing some).

When we get questions about why we do stuff the way we do, and I need to reply with a direct link to the answer.

The steps involved were:

  • Find the part of the documentation that refers to it
  • highlight the section before and after the header that has the id
  • select view source
  • highlight the id value between the "
  • Right click and copy that to the clipboard
  • Close the tab and return to the documentation page
  • Click on the documentation page url
  • Place the curser at the end of the url
  • Add a #
  • Paste the id value from the buffer.

The problems encountered are

  • The ID selection requires dexterity that may not be available at the time, early in the morning, late at night, on the train or bus
  • The browser defaults to selecting the full url path, so adding the # or pasting the url replaces the url rather than adding to it.
  • I forgot to add the # and so the link doesn't work

The steps involved now are:

  • Find the part of the documentation that refers to it (Ctrl F)
  • Click on the full stop link (ESC and tab to get to link)
  • Copy the working url (Ctrl C)

This is a lot less error prone and allows me to direct questions to the exact location on the page.

It's there on request of the biggest user of the page by far, namely me. The menus at the top of the page contains only 14 of the 96 links on the page (and is missing some). When we get questions about why we do stuff the way we do, and I need to reply with a direct link to the answer. The steps involved were: * Find the part of the documentation that refers to it * highlight the section before and after the header that has the `id` * select view source * highlight the id value between the `"` * Right click and copy that to the clipboard * Close the tab and return to the documentation page * Click on the documentation page url * Place the curser at the end of the url * Add a `#` * Paste the `id` value from the buffer. The problems encountered are * The ID selection requires dexterity that may not be available at the time, early in the morning, late at night, on the train or bus * The browser defaults to selecting the full url path, so adding the `#` or pasting the url replaces the url rather than adding to it. * I forgot to add the `#` and so the link doesn't work The steps involved now are: * Find the part of the documentation that refers to it (Ctrl F) * Click on the full stop link (ESC and tab to get to link) * Copy the working url (Ctrl C) This is a lot less error prone and allows me to direct questions to the exact location on the page.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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: rho_n/hpr_generator#172
No description provided.