nodejs / nodejs.org

The Node.js® Website
https://nodejs.org
MIT License
6.15k stars 6.21k forks source link

bad relative links in blog feed #1817

Closed boneskull closed 5 years ago

boneskull commented 6 years ago

The blog feed (https://nodejs.org/en/feed/blog.xml) has a base "channel link" of https://nodejs.org/en/. Bare anchor links fail to work, e.g., #notable-changes, because they resolve relative to the channel link. For example: https://nodejs.org/en/#notable-changes.

I think the channel link needs to point to https://nodejs.org/<lang>/blog/.

boneskull commented 6 years ago

I have spent a bit of time looking in to fixing this, and it's not clear where the fix needs to be:

But I have confirmed it's not a reader-specific bug, because I've reproduced the behavior on multiple readers.

fhemberger commented 5 years ago

@boneskull Sorry it took a while to look into this.

site.url should be https://nodejs.org/<lang>/blog/ instead of https://nodejs.org/<lang>/ only for the RSS feeds. Unfortunately, we can't pass a custom value as parameter. This is actually an issue in metalsmith-feed, maybe you can raise an issue there.

See: https://github.com/hurrymaplelad/metalsmith-feed/blob/master/metalsmith_feed.js#L27

boneskull commented 5 years ago

@fhemberger Is this worth bothering with? Wondering if we are hitching our wagon to Metalsmith for the foreseeable future, or whether a next-generation nodejs.org site would use different tech...

fhemberger commented 5 years ago

I don't know. Might still be worth reporting, also for the sake of others. But I'll leave that up to you.

ghost commented 5 years ago

I think the channel link needs to point to https://nodejs.org/<lang>/blog/

@boneskull:Now it doesn't seem we should translate blogs into other langs. So the default url will be directed to https://nodejs.org/en/blog/. :)

fhemberger commented 5 years ago

@boneskull I'm closing this issue for now. Feel free to open one for metalsmith-feed, we are happy to accept a PR once it's fixed.