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

Fix links for hugo #1810

Merged
merged 6 commits into from
Aug 9, 2024
Merged

Conversation

harding
Copy link
Collaborator

@harding harding commented Aug 3, 2024

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:

  1. Checkout this branch
  2. Build the tip: make clean all (all tests should pass)
  3. Backup the generated site: cp -a _site _new_site
  4. Checkout the merge root, something like git reset --hard HEAD^10
  5. Build the site again: make clean build
  6. Diff the resultant HTML: 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.

@harding harding marked this pull request as draft August 3, 2024 17:48
@harding
Copy link
Collaborator Author

harding commented Aug 3, 2024

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.
@harding
Copy link
Collaborator Author

harding commented Aug 4, 2024

Converted to draft. Found an edge case with the Hugo include code that breaks footnotes; fixing that may allow dropping some of these commits.

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.

@harding harding marked this pull request as ready for review August 4, 2024 15:33
Copy link
Contributor

@bitschmidty bitschmidty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

  • reviewed each commit (thanks for the descriptions @harding )
  • built and diff'd locally
  • reviewed diff logs

lgtm, thanks for all your effort on this transition again, @harding

Ok to merge when you see fit from your perspective.

@harding harding merged commit dcd385c into bitcoinops:master Aug 9, 2024
2 checks passed
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