-
Notifications
You must be signed in to change notification settings - Fork 922
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
create child page
should not include the "parent" filename in the GH repo path as it breaks github's preview tab
#668
Comments
funny you should open this issue as I hit the same thing just a couple of days ago and was going to open a PR! |
Hi @spkane, I would like to work on this issue. |
@mahi072 The diff shows the file name at the top.
https://github.com/google/docsy/blob/main/layouts/partials/page-meta-links.html |
issue google#668 The proposed changes is the enhancement of the code to remove the parent filename in the GH repo path.
Problem
When you click
create child page
on a docsy site, you end up with a URL that starts like this:https://github.com/google/docsy-example/new/master/content/en/docs/_index.md?filename=change-me.md
This works, unless you happen to actually look at the Preview tab, as this causes Github to compare the new
change-me.md
file with_index.md
, which is not what the user is expecting (and not even what will happen when the PR is made).Fix
Fixing this simply requires that the parent filename is not included in the URL, like so:
https://github.com/google/docsy-example/new/master/content/en/docs/?filename=change-me.md
With this small change the preview now works as expected:
Potential Code Change
There is likely a more elegant way to fix this upstream, so I am not creating a PR initially, but this is what I ended up doing to fix it locally.
The text was updated successfully, but these errors were encountered: