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

base logo link visits undefined rather than href url #1473

Open
mroswell opened this issue Sep 18, 2021 · 2 comments
Open

base logo link visits undefined rather than href url #1473

mroswell opened this issue Sep 18, 2021 · 2 comments

Comments

@mroswell
Copy link
Sponsor Contributor

I have two connected sites:
http://www.SaferOrToxic.org
(a Hugo website)
and:
http://disinfectants.SaferOrToxic.org/disinfectants/listN
(a datasette table page)

The latter is linked as "The List" in the former's menu.
(I'd love a prettier URL, but that's what I've got.)

On:
http://disinfectants.SaferOrToxic.org/disinfectants/listN
... all the other menu links should point back to:
https://www.SaferOrToxic.org
And they do!

But the logo, for some reason--though it has an href pointing to:
https://www.SaferOrToxic.org
Keeps going to this instead:
https://disinfectants.saferortoxic.org/disinfectants/undefined

What is causing that? How can I fix it?

In #1284 back in March, I was doing battle with the index.html template, in a still unresolved issue. (I wanted only a single table page at the root.)

But I thought, well, if I can't resolve that, at least I could just point the main website to the datasette page ("The List,") and then have the List point back to the home website.

The menu hrefs to https://www.SaferOrToxic.org work just fine, exactly as they should, from the datasette page. Even the Home link works properly.

But the logo link keeps rewriting to: https://disinfectants.saferortoxic.org/disinfectants/undefined

This is the HTML:

<a class="text-3xl font-bold leading-none" href="https://www.saferortoxic.org"><img src="https://www.saferortoxic.org/images/logo_hu26e4dce8d5931af1ea33526b28fc8383_9734_c52a4f1635ef88bda858373270551ed2.webp" class="custom-logo" alt="Logo: Safer or Toxic?" width="300px"></a>

Is this somehow related to cloudflare?
Or something in the datasette code?

I'm starting to think it's a cloudflare issue.
Screen Shot 2021-09-18 at 12 09 57 AM

Can I at least rule out it being a datasette issue?

My repository is here:
https://github.com/mroswell/list-N

(BTW, I couldn't figure out how to reference a local image, either, on the datasette side, which is why I'm using the image from the www home page.)

@mroswell mroswell changed the title baseof Logo href points to undefined rather than href url base logo href points to undefined rather than href url Sep 18, 2021
@mroswell mroswell changed the title base logo href points to undefined rather than href url base logo link visits undefined rather than href url Sep 18, 2021
@mroswell
Copy link
Sponsor Contributor Author

An update, if I remove the img tag and replace it with the text, "Safer or Toxic?" it links to the right place.

Also, if I keep things exactly as they are, and it improperly, but consistently goes to the undefined page, on THAT 404 page, a click on the image properly clicks through to the www.SaferOrToxic.org page.

Weird stuff.

@mroswell
Copy link
Sponsor Contributor Author

mroswell commented Sep 19, 2021

I replaced:

<a class="text-3xl font-bold leading-none" href="https://www.saferortoxic.org">
<img 
src="https://www.saferortoxic.org/images/logo_hu26e4dce8d5931af1ea33526b28fc8383_9734_c52a4f1635ef88bda858373270551ed2.webp" 
class="custom-logo" 
alt="Logo: Safer or Toxic?" 
width="300px">
</a>

with:

<img src="https://www.saferortoxic.org/images/logo_hu26e4dce8d5931af1ea33526b28fc8383_9734_c52a4f1635ef88bda858373270551ed2.webp" 
alt="Logo: Safer or Toxic?" 
style="width:300px; cursor:pointer;" 
onclick="window.location.href='https://saferortoxic.org';return false;">

I'd still love to know what caused this (and how to troubleshoot to figure it out), so I'll leave it open for a bit, but I do have a functional logo linking to the Hugo home page, at least locally. I'll likely push tomorrow.

(Before trying this, I tried to apply a background image to the a tag. That didn't work.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant