docsy: Broken logic for building GitHub URL for "Edit this page" link

Hallo to the Docsy theme team 😃

The page-meta-links partial layout (at line 8) contains the following code, which doesn’t look right:

{{ if and ($gh_subdir) (.Site.Language.Lang) }}

I tried removing the and, and I also tried moving the and to between the two bracketed clauses, but neither of those updates works as expected. So I’ve decided to hand this problem over to people who have more background into the recent updates to that file.

I found the above code while investigating a problem when upgrading Kubeflow to the latest Docsy. Kubeflow does not use a language directory, and therefore doesn’t need the /en inserted into the GitHub path. On testing the upgrade, we found that the latest version of Docsy insists on including /en in the file path. (Thank you to @joeliedtke for pointing out that the ā€œEdit this pageā€ link was broken!)

For Kubeflow, we’ll to continue using our custom layout, which checks .Site.IsMultiLingual to determine whether to add the /en or not. We need the custom layout anyway at this stage, because it contains the code to inject the page URL into the issue body when creating an issue. See feature request https://github.com/google/docsy/issues/91. At some stage, though, it’ll be good to remove our custom layout and use the standard Docsy one, when both these issues are fixed.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 19 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Running into the same issue