linkerd / website

Source code for the linkerd.io website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edge docs incorrectly state that the corresponding stable docs don't exist

wmorgan opened this issue · comments

Currently on https://linkerd.io/2-edge/features/proxy-injection/ you see this banner:

image

But the corresponding doc does exist. https://linkerd.io/2.15/features/proxy-injection/

Something is busted in this logic. cc @alpeb @kflynn

The way this logic is written, it's only going to work on Section pages.

For example:
It works here: https://linkerd.io/2.14/features/
But not here: https://linkerd.io/2.14/features/ingress/

This probably broke in v0.123.0 when the behavior of .Page.Path changed. That method is now stripping the file extension which is required in the fileExists function when checking for a regular page.

{{ fileExists "/2.14/features/ingress/" }} → false
{{ fileExists "/2.14/features/ingress.md" }} → true

See docs:
https://gohugo.io/methods/page/path/
https://gohugo.io/functions/os/fileexists/

It's also potentially problematic to use .Page.Path to look up a file path, since this value is neither a file path nor a relative URL. It is a logical identifier for each page.

We probably need to switch to using the .Page.File method when trying to create a string that represents the latest file path.

Thank you!