-
Notifications
You must be signed in to change notification settings - Fork 122
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
Fix links for hugo #1810
Fix links for hugo #1810
Conversation
Converted to draft. Found an edge case with the Hugo include code that breaks footnotes; fixing that may allow dropping some of these commits. |
Jekyll's markdown parser (Kramdown) is largely whitespace agnostic. Hugo's commonmark parser (Goldmark) is strict about whitespace, so we change the indedentation of some things so that links within the content are correctly rendered when the site is compiled with Hugo.
Hugo doesn't use the same comments syntax as Jekyll. We'll eventually need to address that, but here we simply delete a few unnecessary comments that contain link definitions and so are causing our tests to fail on Hugo.
Most of the conversion from Jekyll to Hugo is being done with simple sed scripts. It's much easier to write those scripts when each unit of information is entirely contained on a single line.
Some files have spaces between a link title and its reference name. In Jekyll, these are turned into the expected links 100% of the time. In Hugo, it's only 95% of the time; it seems to incorrectly link them if there's an open parenthesis nearby.
Hugo found a few links that don't follow proper URL encoding, i.e. we left an unmatched parenthesis on the end. Fix 'em.
Having the end auto_anchor function near link definitions messes them up in Hugo, so add some newlines.
d1982b9
to
1a9d8db
Compare
Converting back to Ready For Review. Fixed the edge case and updated this PR to drop about half the commits, making it a much smaller PR that should be easier to review. The same review suggestions from the OP can be used, but it's now also probably practical to simply review the commit diffs alone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of #1551
This cleans up a bunch of links to make them work correctly with Hugo. Although code review on this PR might be kinda annoying, it's easier to review as an HTML diff as a lot of these changes have no effect on the HTML output:
make clean all
(all tests should pass)cp -a _site _new_site
git reset --hard HEAD^10
make clean build
diff -ruN _site _new_site | colordiff | less -R
I've separate each type of change into its own commit, with the commit message describing the motivation for the change.