Skip to content

Replace Handlebars with Tera #1502

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

Merged
merged 3 commits into from
Mar 8, 2025
Merged

Replace Handlebars with Tera #1502

merged 3 commits into from
Mar 8, 2025

Conversation

senekor
Copy link
Contributor

@senekor senekor commented Mar 5, 2025

This is very similar to #688, with some exceptions:

  • I used snapshot testing over the entire site/ directory to ensure the output is identical.
    The snapshot testing setup is on the branch snapshot_tests.
    If this PR is approved, I will rebase the commits on the master branch to drop the testing setup.
  • I made a separate commit for renaming the template files.
    Viewing the diff of the individual commits should make it easier to review.
  • Tera and Handlebars don't handle HTML escaping exactly the same way, so I added the custom filter escape_hbs to ensure identical output.
    This could probably be removed later without issues.
  • Using macros for headers, nav and footer is not necessary, an include statement would've been more concise.
    But the indent filter only works with macros and it allows identical output and a good diff at the same time.

@Manishearth
Copy link
Member

  • I used snapshot testing over the entire site/ directory to ensure the output is identical.

thank you so much! this is super valuable.

It might be worth having a long term snapshot testing setup checked in to the tree. We won't check in snapshots, but it will allow people to perform these tests conveniently

@senekor
Copy link
Contributor Author

senekor commented Mar 7, 2025

It might be worth having a long term snapshot testing setup checked in to the tree. We won't check in snapshots, but it will allow people to perform these tests conveniently

Alright, I will try to make a PR with a tweaked setup so it can be merged for convenience without getting in the way.

@senekor senekor force-pushed the senekor/hbs-to-tera branch from 57eeb14 to 55bb5a6 Compare March 8, 2025 00:26
@senekor senekor changed the base branch from senekor/tera-testing-base to master March 8, 2025 00:26
@senekor senekor force-pushed the senekor/hbs-to-tera branch from 55bb5a6 to 289218f Compare March 8, 2025 00:28
@senekor senekor merged commit f66c0cd into master Mar 8, 2025
3 checks passed
@senekor senekor deleted the senekor/hbs-to-tera branch March 8, 2025 00:37
@JoHaHu
Copy link

JoHaHu commented Mar 8, 2025

This seems to have broken the rss feed.

@senekor
Copy link
Contributor Author

senekor commented Mar 8, 2025

oof, thanks for the report. I had that excluded from the the snapshot tests because it was non-deterministic with its updated timestamp 🙁 gonna fix this right away

Edit: should be fixed by #1505

@senekor senekor mentioned this pull request Mar 8, 2025
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.

3 participants