Skip to content

Broken logic for building GitHub URL for "Edit this page" link #138

@sarahmaddox

Description

@sarahmaddox

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 #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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions