Hugo migration#98
Draft
maxkapur wants to merge 216 commits into
Draft
Conversation
This seems like the cleanest way to support legacy paths. We'll have to do it for every page, but I think I actually like that better than an automatic rule that generates copies of the pages at the old paths because this makes it explicit what the old URLs were and will be easier to carry through future migrations. Note the "automatic rule" idea mentioned above isn't possible with hugo currently; you can only have one permalink pattern set in hugo.toml for each post. Also note that adding a similar alias rule for pages like `/formatting/` that already had a `permalink:` set in Jekyll isn't necessary. In those cases the permalink replaces the dated path so it would never have resolved anyway. This should ease automated migration.
Create a custom shortcode that renders inline or display mode math depending on whether shortcode was called with inner argument or not. Formats masterpost has an example, but we will need to double check how robust it is to more complicated display equations with backslash escaping etc.
Add link to the blog post I am trying to follow and migrate default styles into that schema. Following the guide only loosely. I don't understand CSS layers yet
Hugo manages paths within assets/ but not within static/
Doesn't look terrible but maybe we revisit the CSS question
Causes needless overflow
Internal links only for now
I like this one better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Yesterday we fiddled with Zola (#97) and today we fiddle with Hugo.
This WIP includes
the same demo posts/pages from beforeall posts and pages. Trying to maintain clean separation between the theme and content.TODOs (many copy/pasted from that PR since they still apply):
$$ ... $$delimiters will need updating to use the custom shortcode. We can regex thissort_ordercustom functionality? Yes!weightkeyhidden: trueposts. See comments inmigrate.py. The weird convention I evolved on the Jekyll site was:menus = ["main"]in frontmatter. Theparams.hiddenkey is dropped in the migration.params.hiddenkey, and will use it to mean "suppress this from the home page." They can still show in full on/postswhich will include previews. The old "browse" view will go away or perhaps be relegated to the styled atom feed.katex: truefrontmatter element to indicate pages where it's needed, but migration script flagged that I was actually quite inconsistent in using this. Probably we can just drop it since katex CSS is needed on the homepage anyway and it'll be in cache./colophon/:)aliases:frontmatter field works and note interaction with Jekyll'spermalink:(which we are now going to implement as an aliases).<icon>: https://validator.w3.org/feed/docs/atom.html<!--more-->separator, but not my convention of omitting it when the post is supposed to be its own summary (i.e. appear in full on the homepage)summaryLength = 99999in settings so that the automatic summary for posts without the delimiter is just the whole post<!--more-->separators need manual audit: I included it inline in some paragraphs to cut off a footnote (footnotes styled weird on the old homepage). Hugo will only respect the separator if it's on its own line, and unclear how it will behave with footnotes. Investigatemigrate.py) and use weight to break ties in sort ordermigrate.pyscript, grown slowly during this process, automates most of the migration steps. Here are a few migrations I did manually:content/posts/2025-12-19-perfect-match-integer-programming.mdrelative. (For some reason I used absolute URLs generated via{{ site.baseurl }}to embed images in this post and no others.)content/posts/2024-09-24-bimatrix-game-equilibrium.md(paragraph beginning and ending in inline KaTeX regex matched as display KaTeX)Ideas that can happen after migrating:
/static/assets/images.