Skip to content

Fix suggest edit feature #89

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

Closed
wants to merge 1 commit into from
Closed

Fix suggest edit feature #89

wants to merge 1 commit into from

Conversation

trsvchn
Copy link

@trsvchn trsvchn commented Jun 30, 2021

Issue

Because of symlinking to the content from the site dir the resulting location of markdown files will be
...main/site/content/ NOT ...main/content/

Example

Thus, pressing on suggest edit button redirects to 404:
Screenshot from 2021-06-30 12-37-25
Screenshot from 2021-06-30 12-39-36

In this example we get:

https://github.com/numpy/numpy-tutorials/edit/main/site/content/tutorial-svd.md

But the actual location is:

https://github.com/numpy/numpy-tutorials/edit/main/content/tutorial-svd.md

Proposed Solution

This PR just swaps content dir ant its symlink:

  • content dir goes to site
  • content symlink goes to the repo root dir

@rossbar
Copy link
Collaborator

rossbar commented Jun 30, 2021

Thanks for the suggestions @trsvchn .

The main issue seems to be that the edit this page feature of the sphinx book theme doesn't work properly because of the symlinked content structure. IMO it'd be better to keep the current symlinking structure (i.e. the site content links to content) because content is the "main" folder in some sense - i.e. for users who are running the notebooks interactively either locally or on binder.

Alternatively, maybe we could see if there is a way to accommodate the current directory structure by modifying the theme configuration, or even suggesting an additional feature to the theme if it's not currently supported.

@trsvchn
Copy link
Author

trsvchn commented Jun 30, 2021

@rossbar Thank you for your fast response on this!

ok, I'll try to look at the book theme config (thanks for the link) and try to adapt it to the current dir structure.

@trsvchn trsvchn changed the title Fix content symlinking Fix suggest edit feature Jun 30, 2021
@trsvchn trsvchn marked this pull request as draft June 30, 2021 10:32
@bsipocz bsipocz force-pushed the main branch 3 times, most recently from e2ff80f to 5d5889e Compare April 20, 2023 21:27
@trsvchn trsvchn closed this by deleting the head repository Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants