Skip to content
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

Relatieve links van geïmporteerde repos worden niet correct verwerkt #401

Open
simonpauw opened this issue Jul 9, 2021 · 2 comments
Open

Comments

@simonpauw
Copy link

Bijvoorbeeld:

Vanuit materials.yml impoerteer ik sp1-python als python

In de python directory zit de pagina en/dictionaries/index.md. Het pad hiernaar wordt /python/en/dictionaries/, zoals verwacht.

Maar, in de de index.md zit een relatieve link: basic-operations/
Dit wordt omgezet naar /materials/python/en/dictionaries/basic-operations/
in plaats van /python/en/dictionaries/basic-operations/

Dit maakt het nu onmogelijk om relatieve links te gebruiken binnen de opdrachten repo's

@stgm
Copy link
Owner

stgm commented Jul 13, 2021

Goeie! Is op te lossen.

@stgm
Copy link
Owner

stgm commented Jul 14, 2021

Correctie: is niet zo goed op te lossen. Relatieve links zijn sowieso finicky in HTML omdat er een verschil is als de huidige URL met een slash eindigt of niet.

Dus het ligt voor de hand om sowieso absolute URLs te gebruiken. De vraag is dan of je die nog automatisch wil prefixen.

  • Stel je maakt vanuit de sp1-python repo een link naar /en/dictionaries/basic-operations, dan zouden we daar automatisch python voor kunnen plakken.
  • Maar als je dan wil teruglinken naar /welke andere pagina dan ook dan komt er ook python voor.
  • En als je in de main repo zit, waar de meeste links staan, dan wil je waarschijnlijk sowieso alles handmatig linken dus geen automatische prefixes.

Als je het dus zo doet dan kun je niet meer teruglinken van een subrepo naar andere delen van de cursus. Denk dat dat wel tot problemen kan leiden?

Dus ik zou zeggen dat er twee opties zijn:

  1. Alles helemaal handmatig linken.
  2. Relatieve links prefixen, dus jij linkt naar en/dictionaries/basic-operations zonder slash en dan komt er automatisch /python/ voor. Absolute links worden met rust gelaten.

Dat laatste is makkelijk aan te passen maar is het goed werkbaar?

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

No branches or pull requests

2 participants