Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “compatibility mode” to support legacy httkweb template naming by preferring .httkweb.html templates when both legacy and modern template variants exist.
Changes:
- Introduce
compatibility_modeinSiteConfigand plumb it throughcreate_asgi_app(),serve(), andpublish(). - Add
HttkCompatTemplateEnginethat reorders template suffix probing to prefer legacy.httkweb.html. - Add tests ensuring compatibility mode prefers legacy templates for both ASGI serving and static publishing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_api.py | Adds regression tests validating legacy template selection in compatibility mode. |
| src/httk/web/templating/jinja2_engine.py | Makes template suffix probing configurable per engine instance. |
| src/httk/web/templating/httk_compat.py | Adds a legacy-oriented template engine that prioritizes .httkweb.html. |
| src/httk/web/templating/base.py | Introduces a TemplateEngine Protocol for typing the engine interface. |
| src/httk/web/templating/init.py | Exports the new protocol and compatibility engine. |
| src/httk/web/model/config.py | Adds compatibility_mode to SiteConfig and from_srcdir(). |
| src/httk/web/engine/site_engine.py | Selects template engine implementation based on compatibility_mode. |
| src/httk/web/api.py | Exposes compatibility_mode at the public API layer for app creation and publishing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.