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

Data migration: Finish baseurl conversion #1015

Closed
2 of 4 tasks
ChristopherChudzicki opened this issue Feb 16, 2022 · 2 comments
Closed
2 of 4 tasks

Data migration: Finish baseurl conversion #1015

ChristopherChudzicki opened this issue Feb 16, 2022 · 2 comments

Comments

@ChristopherChudzicki
Copy link
Contributor

ChristopherChudzicki commented Feb 16, 2022

Finish the baseurl -> resource_link conversion started in #1002

Known remaining edge cases:

  1. links with document fragments, e.g., [calendar]({{< baseurl >}}/pages/syllabus#Calendar)

  2. links where the link text has square brackets or newlines (not double newlines—those aren't links according to Markdown).

  3. links where the link casing is different from dirpath / filename casing, e.g., [Syllabus]({{< baseurl >}}/path/to/Syllabus) where the syllabus filename is syllabus not Syllabus.

  4. Links where the title is an image, e.g.
    [![Boundary conditions animation.](/courses/civil-and-environmental-engineering/1-061-transport-processes-in-the-environment-fall-2008/lecture-notes/movie.jpg)]({{< baseurl >}}/resources/bounds3)

    ⚠️ Investigate the usage images in titles. Do we actually want to migrate/support this in future?

Related:

@ChristopherChudzicki
Copy link
Contributor Author

Even after #1013, the square bracket links BEFORE baseurl shortcodes are being escaped. See for example https://github.mit.edu/ocw-content-rc/18.04-fall-1999/commit/97032ead4f7bf3810c758522b30451dfc7538f00#diff-9674b1ed65559a66e97cbc6ada224051L24-R24

Consequences:

  • this will break the baseurl link if they were working

BUT: Since we are working on replacing baseurl with resource_link anyway...one option is to not worry about this and just alter to replacement regex to catch both the escaped version (\[link title\]({{ baseurl}/...)) and unescaped version ([link title]({{ baseurl}/...))

@ChristopherChudzicki
Copy link
Contributor Author

ChristopherChudzicki commented Apr 11, 2022

Closed in favor of Closing this in favor of #1233

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

1 participant